@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@700&display=swap');

:root {
  --bg: #0a0a1a;
  --surface: #12122a;
  --card: #1a1a3a;
  --text: #e8e8f0;
  --text-muted: #8888aa;
  --accent: #7c4dff;
  --accent-light: #b388ff;
  --gold: #ffd54f;
  --radius: 12px;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html { overflow-x: hidden; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  max-width: 100vw;
}

/* 3D Canvas Background */
#celestial-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  animation: celestialFadeIn 2s ease-out;
}
@keyframes celestialFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

header {
  position: relative;
  z-index: 1;
  padding: 1.25rem 2.5rem;
  padding-bottom: 2.5rem;
  background: rgba(10, 10, 26, 0.75);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  -webkit-mask-image: linear-gradient(to bottom,
    black 0%,
    black 40%,
    rgba(0, 0, 0, 0.85) 55%,
    rgba(0, 0, 0, 0.6) 70%,
    rgba(0, 0, 0, 0.3) 85%,
    rgba(0, 0, 0, 0.1) 93%,
    transparent 100%
  );
  mask-image: linear-gradient(to bottom,
    black 0%,
    black 40%,
    rgba(0, 0, 0, 0.85) 55%,
    rgba(0, 0, 0, 0.6) 70%,
    rgba(0, 0, 0, 0.3) 85%,
    rgba(0, 0, 0, 0.1) 93%,
    transparent 100%
  );
}

nav {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

nav a { color: var(--text-muted); text-decoration: none; transition: color 0.2s; font-size: 1.25rem; }
nav a:hover { color: var(--accent-light); }
.logo { font-family: 'Cinzel', serif; font-size: 2.75rem; font-weight: 700; color: var(--gold) !important; letter-spacing: 1px; display: flex; align-items: center; gap: 0.85rem; }
.logo-img { height: 125px; width: 125px; }

header, main, footer { max-width: 100vw; }
main { width: min(1200px, 100%); margin-inline: auto; padding: 2rem 1.5rem; position: relative; z-index: 1; }
main > * { max-width: 100%; }

/* Hero — text hidden until intro swoop completes */
.hero {
  text-align: center;
  padding: 1.5rem 1rem 2rem;
  min-height: 40vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  max-width: 100%;
}
.hero h1 {
  font-size: 4rem;
  max-width: 100%;
  word-wrap: break-word;
  background: linear-gradient(135deg, var(--gold), var(--accent-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 1.4s ease, transform 1.4s ease;
}
.hero p {
  color: var(--text-muted);
  margin-top: 0.5rem;
  font-size: 1.6rem;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 1.2s ease 0.3s, transform 1.2s ease 0.3s;
}
.hero.hero-revealed h1,
.hero.hero-revealed p {
  opacity: 1;
  transform: translateY(0);
}

/* Zodiac Grid */
.zodiac-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 1rem;
  padding: 1rem 0 3rem;
  margin-top: 80vh;
}

.zodiac-tile {
  background: rgba(26, 26, 58, 0.5);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(124, 77, 255, 0.15);
  border-radius: var(--radius);
  padding: 2.5rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: var(--text);
  font-family: inherit;
  font-size: inherit;
}
/* Scroll reveal: only hide tiles after JS initializes (prevents layout shift) */
.zodiac-grid.scroll-ready .zodiac-tile {
  opacity: 0;
  transform: translateY(40px) scale(0.92);
  transition: all 0.3s, opacity 0.7s ease, transform 0.7s ease;
  transition-delay: calc(var(--stagger, 0) * 0.06s);
}
.zodiac-grid.scroll-ready .zodiac-tile.tile-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}
.zodiac-tile:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(124, 77, 255, 0.25);
  background: rgba(26, 26, 58, 0.7);
}
.zodiac-symbol { font-size: 3.4rem; }
.zodiac-name { font-weight: 600; font-size: 1.35rem; }
.zodiac-dates { font-size: 1.05rem; color: var(--text-muted); }

/* Horoscope Display */
.horoscope-display { padding: 1rem 0 3rem; }
.back-btn {
  background: none;
  border: 1px solid var(--text-muted);
  color: var(--text-muted);
  padding: 0.85rem 1.7rem;
  border-radius: 10px;
  cursor: pointer;
  margin-bottom: 1.5rem;
  font-size: 1.15rem;
  font-family: inherit;
}
.back-btn:hover { border-color: var(--accent-light); color: var(--accent-light); }

.horoscope-card {
  background: rgba(26, 26, 58, 0.6);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(124, 77, 255, 0.2);
  border-radius: var(--radius);
  padding: 3rem;
}
.horoscope-card h2 { font-size: 2.8rem; margin-bottom: 0.25rem; }
.sign-date { color: var(--text-muted); margin-bottom: 0.25rem; }
.sign-profile { color: var(--accent-light); font-size: 1rem; margin-bottom: 1.5rem; letter-spacing: 0.5px; }
.horoscope-content p { margin-bottom: 1rem; line-height: 1.8; }

/* Forecast Grid */
.forecast-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(124, 77, 255, 0.15);
}
.forecast-item {
  background: rgba(18, 18, 42, 0.5);
  border: 1px solid rgba(124, 77, 255, 0.1);
  border-radius: 10px;
  padding: 1.25rem;
}
.forecast-item h3 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--gold);
  margin-bottom: 0.75rem;
}
.forecast-item p {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text);
}

.horoscope-meta {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(124, 77, 255, 0.15);
}
.meta-item { text-align: center; }
.meta-label { display: block; font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; }
.meta-value { display: block; font-size: 1.3rem; font-weight: 600; color: var(--gold); margin-top: 0.25rem; }

/* Cosmic Intensity Dots */
.intensity-bar { display: flex; gap: 3px; justify-content: center; margin-top: 0.35rem; }
.intensity-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: rgba(124, 77, 255, 0.2);
}
.intensity-dot.active { background: var(--gold); }

/* Cosmic Profile */
.cosmic-profile {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(124, 77, 255, 0.15);
}
.cosmic-profile h3 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--gold);
  margin-bottom: 1rem;
}
.profile-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem 1.5rem;
}
.profile-item {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(124, 77, 255, 0.08);
}
.profile-item-label { color: var(--text-muted); font-size: 0.85rem; }
.profile-item-value { color: var(--text); font-weight: 500; font-size: 0.85rem; }

/* Planetary Influence Note */
.planetary-note {
  margin-top: 1.5rem;
  padding: 1.25rem;
  background: rgba(18, 18, 42, 0.4);
  border-radius: 10px;
  border-left: 3px solid var(--accent);
}
.planetary-note h3 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--accent-light);
  margin-bottom: 0.5rem;
}
.planetary-note p {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text);
  font-style: italic;
}

/* CTA */
.cta {
  text-align: center;
  padding: 3rem 1.5rem;
  margin-top: 1rem;
  border-radius: var(--radius);
  background: rgba(18, 18, 42, 0.5);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(124, 77, 255, 0.1);
}
.cta h2 { font-size: 2.7rem; margin-bottom: 0.5rem; }
.cta p { color: var(--text-muted); margin-bottom: 1.5rem; font-size: 1.35rem; }
.cta-button {
  display: inline-block;
  background: var(--accent);
  color: white;
  padding: 1.2rem 3rem;
  border-radius: 12px;
  font-size: 1.3rem;
  text-decoration: none;
  font-weight: 600;
  transition: background 0.2s;
}
.cta-button:hover { background: var(--accent-light); }

/* Blog List */
.blog-list { padding: 2rem; }
.blog-list h1 {
  font-size: 2rem;
  background: linear-gradient(135deg, var(--gold), var(--accent-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.subtitle { color: var(--text-muted); margin-bottom: 2rem; }

.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}
.post-card {
  background: var(--card);
  border: 1px solid rgba(124, 77, 255, 0.15);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.2s;
}
.post-card:hover { transform: translateY(-2px); }
.post-card img { width: 100%; height: 200px; object-fit: cover; }
.post-card-body { padding: 1.2rem; }
.post-card-body h2 { font-size: 1.1rem; margin: 0.5rem 0; }
.post-card-body h2 a { color: var(--text); text-decoration: none; }
.post-card-body h2 a:hover { color: var(--accent-light); }
.post-card-body p { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 0.5rem; }
.post-card-body time { font-size: 0.8rem; color: var(--text-muted); }

.category {
  display: inline-block;
  background: rgba(124, 77, 255, 0.15);
  color: var(--accent-light);
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.load-more {
  display: block;
  text-align: center;
  margin-top: 2rem;
  color: var(--accent-light);
  text-decoration: none;
}
.empty { text-align: center; color: var(--text-muted); padding: 3rem 0; }

/* Blog Post */
.blog-post { max-width: 800px; margin: 0 auto; padding: 2rem; }
.blog-post .hero-image { width: 100%; max-height: 400px; object-fit: cover; border-radius: var(--radius); margin-bottom: 0.5rem; }
.blog-post .image-credit { font-size: 0.75rem; color: var(--text-muted); margin-bottom: 1rem; }
.blog-post h1 { font-size: 2rem; margin: 0.75rem 0 0.5rem; }
.blog-post time { font-size: 0.85rem; color: var(--text-muted); display: block; margin-bottom: 2rem; }
.blog-post .content { line-height: 1.8; }
.blog-post .content p { margin-bottom: 1.2rem; }
.blog-post .content h2 { font-size: 1.4rem; margin: 2rem 0 0.8rem; color: var(--gold); }
.blog-post .content h3 { font-size: 1.2rem; margin: 1.5rem 0 0.6rem; }
.blog-post .content ul, .blog-post .content ol { margin: 1rem 0 1rem 1.5rem; }
.blog-post .content li { margin-bottom: 0.4rem; }
.back-link { display: inline-block; margin-top: 2rem; color: var(--accent-light); text-decoration: none; }

/* Footer */
footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 2rem;
  color: var(--text-muted);
  font-size: 1.15rem;
  background: rgba(10, 10, 26, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid rgba(124, 77, 255, 0.1);
}
.footer-links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 1.15rem;
  transition: color 0.2s;
}
.footer-links a:hover { color: var(--accent-light); }

/* Legal Pages */
.legal-page {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem;
  position: relative;
  z-index: 1;
}
.legal-page h1 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, var(--gold), var(--accent-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.legal-page .last-updated { color: var(--text-muted); font-size: 0.85rem; margin-bottom: 2rem; display: block; }
.legal-page h2 { font-size: 1.3rem; color: var(--gold); margin: 2rem 0 0.8rem; }
.legal-page p { margin-bottom: 1rem; line-height: 1.8; }
.legal-page ul { margin: 0.5rem 0 1rem 1.5rem; }
.legal-page li { margin-bottom: 0.4rem; line-height: 1.6; }
.legal-page a { color: var(--accent-light); }

/* Cookie Consent Banner */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  background: rgba(18, 18, 42, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(124, 77, 255, 0.3);
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  font-size: 1.1rem;
}
.cookie-banner p { color: var(--text); margin: 0; }
.cookie-banner a { color: var(--accent-light); }
.cookie-banner-actions { display: flex; gap: 0.75rem; }
.cookie-btn {
  padding: 0.75rem 1.8rem;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 1.1rem;
  font-weight: 600;
  transition: opacity 0.2s;
}
.cookie-btn:hover { opacity: 0.85; }
.cookie-btn-accept { background: var(--accent); color: white; }
.cookie-btn-reject { background: transparent; color: var(--text-muted); border: 1px solid var(--text-muted); }

/* Language Selector */
.lang-selector { position: relative; }

.lang-btn {
  background: none;
  border: 1px solid rgba(136, 136, 170, 0.3);
  color: var(--text-muted);
  padding: 0.5rem;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  transition: all 0.2s;
  font-family: inherit;
}
.lang-btn:hover { border-color: var(--accent-light); color: var(--accent-light); }
.lang-btn svg { width: 22px; height: 22px; }

.lang-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: rgba(18, 18, 42, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(124, 77, 255, 0.2);
  border-radius: 12px;
  padding: 0.5rem;
  min-width: 180px;
  max-height: 400px;
  overflow-y: auto;
  z-index: 1000;
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
}
.lang-dropdown.open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: all;
}

.lang-option {
  display: block;
  width: 100%;
  padding: 0.6rem 1rem;
  color: var(--text);
  text-decoration: none;
  border-radius: 8px;
  font-size: 0.95rem;
  transition: background 0.15s;
  white-space: nowrap;
}
.lang-option:hover { background: rgba(124, 77, 255, 0.15); }
.lang-option.active { color: var(--gold); font-weight: 600; }

/* Nav layout for language selector */
nav { gap: 1.5rem; }
.nav-links { display: flex; align-items: center; gap: 1.5rem; }

/* RTL support */
[dir="rtl"] .lang-dropdown { right: auto; left: 0; }
[dir="rtl"] nav { direction: rtl; }

/* ── Tablet (601px–1024px) ── */
@media (max-width: 1024px) {
  main { padding: 1.5rem 1.25rem; }
  .hero { padding: 3rem 1rem 1.5rem; min-height: 30vh; }
  .hero h1 { font-size: 3rem; }
  .hero p { font-size: 1.35rem; }
  .zodiac-grid { grid-template-columns: repeat(4, 1fr); gap: 0.85rem; margin-top: 60vh; }
  .zodiac-tile { padding: 1.8rem 1.2rem; }
  .zodiac-symbol { font-size: 2.8rem; }
  .zodiac-name { font-size: 1.15rem; }
  .cta { padding: 2.5rem 1.25rem; }
  .cta h2 { font-size: 2.2rem; }
  .cta-button { padding: 1rem 2.2rem; font-size: 1.15rem; }
  .forecast-grid { grid-template-columns: repeat(3, 1fr); }
  .profile-grid { grid-template-columns: repeat(2, 1fr); }
  .posts-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
  .blog-post { padding: 1.5rem 1.25rem; }
  .legal-page { padding: 1.5rem 1.25rem; }
}

/* ── Phone (≤600px) ── */
@media (max-width: 600px) {
  header { padding: 0.5rem 1rem; }
  .logo { font-size: 1.9rem; }
  .logo-img { height: 75px; width: 75px; }
  nav a { font-size: 1.05rem; }
  main { padding: 1rem; }
  .hero { padding: 2rem 0.5rem 1rem; min-height: 25vh; }
  .hero h1 { font-size: 2.2rem; }
  .hero p { font-size: 1.15rem; }
  .zodiac-grid { grid-template-columns: repeat(3, 1fr); gap: 0.6rem; margin-top: 50vh; }
  .zodiac-tile { padding: 1.4rem 0.8rem; }
  .zodiac-symbol { font-size: 2.4rem; }
  .zodiac-name { font-size: 1.05rem; }
  .zodiac-dates { font-size: 0.85rem; }
  .horoscope-card { padding: 1.8rem; }
  .horoscope-card h2 { font-size: 1.9rem; }
  .forecast-grid { grid-template-columns: 1fr; }
  .horoscope-meta { grid-template-columns: repeat(2, 1fr); }
  .profile-grid { grid-template-columns: 1fr; }
  .sign-profile { font-size: 0.85rem; }
  .cta { padding: 2rem 1rem; }
  .cta h2 { font-size: 1.8rem; }
  .cta p { font-size: 1.15rem; }
  .cta-button { padding: 1rem 2rem; font-size: 1.1rem; }
  .posts-grid { grid-template-columns: 1fr; }
  .blog-post { padding: 1rem; }
  .blog-post h1 { font-size: 1.5rem; }
  .legal-page { padding: 1rem; }
  .legal-page h1 { font-size: 1.5rem; }
  footer { padding: 1.5rem 1rem; }
  .footer-links { gap: 1rem; }
  .cookie-banner { padding: 0.75rem 1rem; gap: 0.75rem; font-size: 0.95rem; flex-direction: column; text-align: center; }
  .lang-dropdown { min-width: 160px; right: -1rem; }
  .lang-btn { width: 36px; height: 36px; }
}

/* Fallback for browsers without backdrop-filter */
@supports not (backdrop-filter: blur(1px)) {
  header { background: rgba(10, 10, 26, 0.95); }
  .zodiac-tile { background: rgba(26, 26, 58, 0.9); }
  .horoscope-card { background: rgba(26, 26, 58, 0.92); }
  .cta { background: rgba(18, 18, 42, 0.9); }
  footer { background: rgba(10, 10, 26, 0.95); }
}

/* Respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  #celestial-bg { animation: none; }
  .hero h1, .hero p { opacity: 1; transform: none; transition: none; }
  .zodiac-tile { transition: none; opacity: 1; transform: none; }
  .post-card { transition: none; }
  .cta-button { transition: none; }
  nav a { transition: none; }
}

/* Hide canvas when printing */
@media print {
  #celestial-bg { display: none; }
  header, .zodiac-tile, .horoscope-card, .cta, footer {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: white;
    color: black;
    border-color: #ccc;
  }
  .hero h1 { -webkit-text-fill-color: black; background: none; }
}
