/* AskMaxie Design System — Full Stylesheet (async load) */
/* Components, calculators, cards, grids, ads, footer, responsive, dark mode */

/* ═══════════════════════════════════════════
   CARDS & GRIDS
   ═══════════════════════════════════════════ */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--s6);
  margin: var(--s8) 0;
}

.card {
  background: var(--white);
  border: 1px solid var(--grey-200);
  border-radius: var(--r-lg);
  padding: var(--s8);
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.04), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  transition: all var(--t-fast);
  text-decoration: none;
  display: block;
  color: inherit;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
  border-color: var(--grey-300);
}

.card h3 {
  font-size: 22px;
  font-weight: 600;
  margin: 0 0 var(--s3);
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.card p {
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-secondary);
  margin: 0;
}

.card-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--r-md);
  background: var(--g-cosmic);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--s4);
  color: var(--white);
  font-size: 24px;
}

/* Feature cards with gradient border */
.card-featured {
  position: relative;
  border: none;
  background: var(--white);
}

.card-featured::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--r-md);
  padding: 2px;
  background: var(--g-cosmic);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

/* ═══════════════════════════════════════════
   LINK GRID
   ═══════════════════════════════════════════ */

.link-grid {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s3) var(--s6);
  margin: var(--s6) 0;
}

.link-grid a {
  font-size: 17px;
  font-weight: 500;
  color: var(--text-primary);
  text-decoration: none;
  padding: var(--s1) 0;
  border-bottom: 2px solid transparent;
  transition: color var(--t-fast), border-color var(--t-fast);
  flex: 1 0 180px;
}

.link-grid a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ═══════════════════════════════════════════
   SECTIONS & DIVIDERS
   ═══════════════════════════════════════════ */

.section-title {
  font-size: 48px;
  font-weight: 600;
  letter-spacing: -0.03em;
  margin: var(--s20) 0 var(--s8);
  color: var(--text-primary);
  line-height: 1.1;
}

.section-subtitle {
  font-size: 19px;
  line-height: 1.6;
  color: var(--text-secondary);
  margin-bottom: var(--s12);
  max-width: 70ch;
  font-weight: 400;
}

.divider {
  text-align: center;
  margin: var(--s12) 0;
  color: var(--grey-300);
  letter-spacing: .5em;
  font-size: 14px;
}

/* ═══════════════════════════════════════════
   HERO IMAGE / PAGE HERO
   ═══════════════════════════════════════════ */

.hero-image,
.page-hero {
  width: 100%;
  max-height: 400px;
  object-fit: cover;
  border-radius: var(--r-lg);
  margin-bottom: var(--s8);
  box-shadow: var(--sh-md);
}

/* ═══════════════════════════════════════════
   EPHEMERIS BAR
   ═══════════════════════════════════════════ */

.ephemeris {
  display: flex;
  gap: var(--s6);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: .02em;
  margin: var(--s6) 0;
  flex-wrap: wrap;
  align-items: center;
}

.ephemeris span {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
}

/* ═══════════════════════════════════════════
   CALCULATORS
   ═══════════════════════════════════════════ */

.calc {
  background: var(--grey-50);
  border: 1px solid var(--grey-200);
  border-radius: var(--r-lg);
  padding: var(--s8);
  margin: var(--s8) 0;
  box-shadow: var(--sh-sm);
}

.calc h3 {
  margin-top: 0;
}

.calc label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: var(--s2);
  letter-spacing: .01em;
}

.calc input,
.calc select {
  width: 100%;
  max-width: 320px;
  padding: 14px 16px;
  font-family: var(--font-sans);
  font-size: 17px;
  border: 1.5px solid var(--grey-200);
  border-radius: var(--r-sm);
  background: var(--white);
  color: var(--text-primary);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
  -webkit-appearance: none;
  appearance: none;
}

.calc input:focus,
.calc select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(124,58,237,.15);
}

.calc button {
  font-family: var(--font-sans);
  font-size: 17px;
  font-weight: 600;
  background: var(--g-cosmic);
  color: var(--white);
  border: none;
  border-radius: var(--r-full);
  padding: 14px 32px;
  margin-top: var(--s4);
  cursor: pointer;
  box-shadow: var(--sh-md);
  transition: transform var(--t-fast), box-shadow var(--t-fast);
}

.calc button:hover {
  transform: translateY(-1px);
  box-shadow: var(--sh-lg), var(--sh-glow);
}

.calc button:active {
  transform: scale(.98);
}

.calc button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(124,58,237,.4);
}

.calc-output {
  margin-top: var(--s6);
  padding: var(--s6);
  background: var(--white);
  border-radius: var(--r-md);
  border: 1px solid var(--grey-200);
  display: none;
}

.calc-output.visible { display: block; }

.calc-output p { margin-bottom: var(--s3); }
.calc-output p:last-child { margin-bottom: 0; }

/* ═══════════════════════════════════════════
   AD SLOTS
   ═══════════════════════════════════════════ */

.ad-slot {
  margin: var(--s10) 0;
  min-height: 250px;
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  border-top: 1px solid var(--grey-200);
  border-bottom: 1px solid var(--grey-200);
  padding: var(--s6) 0;
  background: var(--grey-50);
  border-radius: var(--r-sm);
}

.ad-slot-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--grey-400);
  text-align: center;
  margin-bottom: var(--s2);
}

/* ═══════════════════════════════════════════
   ZODIAC GRID
   ═══════════════════════════════════════════ */

.zodiac-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--s4);
  margin: var(--s8) 0;
}

.zodiac-card {
  text-align: center;
  padding: var(--s8) var(--s6);
  background: var(--white);
  border: 1px solid var(--grey-200);
  border-radius: var(--r-lg);
  text-decoration: none;
  color: var(--text-primary);
  transition: all var(--t-fast);
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.zodiac-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px -4px rgba(0, 0, 0, 0.08);
  border-color: var(--accent);
}

.zodiac-card img {
  width: 72px;
  height: 72px;
  margin: 0 auto var(--s4);
  display: block;
}

.zodiac-card span {
  font-weight: 600;
  font-size: 16px;
  letter-spacing: -0.01em;
}

/* ═══════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════ */

footer {
  background: var(--grey-900);
  color: var(--grey-400);
  padding: var(--s12) var(--s6);
  margin-top: auto;
  font-size: 14px;
}

.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: var(--s8);
  justify-content: space-between;
  align-items: start;
}

.footer-col h4 {
  color: var(--white);
  font-size: 14px;
  font-weight: 600;
  margin-bottom: var(--s4);
  letter-spacing: .02em;
}

.footer-col a {
  display: block;
  color: var(--grey-400);
  text-decoration: none;
  font-size: 14px;
  padding: var(--s1) 0;
  transition: color var(--t-fast);
}

.footer-col a:hover { color: var(--white); }

.footer-bottom {
  max-width: var(--max-w);
  margin: var(--s8) auto 0;
  padding-top: var(--s6);
  border-top: 1px solid var(--grey-800);
  text-align: center;
  font-size: 13px;
  color: var(--grey-500);
}

.footer-bottom a { color: var(--grey-400); margin: 0 var(--s3); }
.footer-bottom a:hover { color: var(--white); }

/* ═══════════════════════════════════════════
   MOBILE NAV TOGGLE
   ═══════════════════════════════════════════ */

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  width: 32px;
  height: 32px;
  position: relative;
}

.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text-primary);
  position: absolute;
  left: 6px;
  transition: transform var(--t-fast), opacity var(--t-fast);
}

.nav-toggle span:nth-child(1) { top: 9px; }
.nav-toggle span:nth-child(2) { top: 15px; }
.nav-toggle span:nth-child(3) { top: 21px; }

.nav-toggle.active span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle.active span:nth-child(2) { opacity: 0; }
.nav-toggle.active span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ═══════════════════════════════════════════
   UTILITY CLASSES
   ═══════════════════════════════════════════ */

.text-gradient {
  background: var(--g-cosmic);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.text-center { text-align: center; }
.text-secondary { color: var(--text-secondary); }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.narrow { max-width: var(--max-w-narrow); margin-left: auto; margin-right: auto; }

/* ═══════════════════════════════════════════
   LAZY LOAD IMAGES
   ═══════════════════════════════════════════ */

img[loading="lazy"] {
  opacity: 0;
  transition: opacity 300ms var(--ease);
}

img[loading="lazy"][src] { opacity: 1; }

/* ═══════════════════════════════════════════
   ANIMATIONS (hardware-accelerated)
   ═══════════════════════════════════════════ */

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.animate-in {
  animation: fadeInUp .6s var(--ease) both;
}

.animate-delay-1 { animation-delay: .1s; }
.animate-delay-2 { animation-delay: .2s; }
.animate-delay-3 { animation-delay: .3s; }

/* ═══════════════════════════════════════════
   DARK MODE
   ═══════════════════════════════════════════ */

@media (prefers-color-scheme: dark) {
  :root {
    --text-primary: var(--grey-100);
    --text-secondary: var(--grey-400);
    --text-inverse: var(--grey-900);
    --bg-primary: var(--grey-900);
    --bg-secondary: var(--grey-800);
  }

  .site-header {
    background: rgba(28,28,30,.82);
    border-bottom-color: var(--grey-700);
  }

  .card,
  .zodiac-card {
    background: var(--grey-800);
    border-color: var(--grey-700);
  }

  .calc {
    background: var(--grey-800);
    border-color: var(--grey-700);
  }

  .calc input,
  .calc select {
    background: var(--grey-900);
    border-color: var(--grey-600);
    color: var(--grey-100);
  }

  .calc-output {
    background: var(--grey-900);
    border-color: var(--grey-700);
  }

  .ad-slot {
    background: var(--grey-800);
    border-color: var(--grey-700);
  }

  .btn-secondary {
    background: var(--grey-800);
    border-color: var(--grey-600);
    color: var(--grey-100);
  }

  .nav-toggle span { background: var(--grey-100); }
}

/* ═══════════════════════════════════════════
   RESPONSIVE — TABLET (768px)
   ═══════════════════════════════════════════ */

@media (max-width: 768px) {
  .card-grid { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
  .zodiac-grid { grid-template-columns: repeat(3, 1fr); }

  .footer-inner { flex-direction: column; gap: var(--s6); }

  .nav-toggle { display: block; }

  .nav-links {
    position: fixed;
    top: var(--nav-h);
    left: 0; right: 0;
    background: var(--white);
    flex-direction: column;
    padding: var(--s6);
    gap: var(--s4);
    border-bottom: 1px solid var(--grey-200);
    box-shadow: var(--sh-lg);
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
    transition: transform var(--t-base), opacity var(--t-base);
  }

  .nav-links.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .nav-links a { font-size: 17px; }

  @media (prefers-color-scheme: dark) {
    .nav-links {
      background: var(--grey-800);
      border-bottom-color: var(--grey-700);
    }
  }
}

/* ═══════════════════════════════════════════
   RESPONSIVE — MOBILE (480px)
   ═══════════════════════════════════════════ */

@media (max-width: 480px) {
  .card-grid { grid-template-columns: 1fr; gap: var(--s4); }
  .zodiac-grid { grid-template-columns: repeat(2, 1fr); }
  .calc { padding: var(--s6); }
  .calc input, .calc select { max-width: 100%; }
  .hero-image, .page-hero { max-height: 240px; }
  .ad-slot { min-height: 200px; }
}

/* ═══════════════════════════════════════════
   REDUCED MOTION
   ═══════════════════════════════════════════ */

@media (prefers-reduced-motion: reduce) {
  .animate-in { animation: none; opacity: 1; transform: none; }
  .card:hover, .zodiac-card:hover, .btn-primary:hover { transform: none; }
  img[loading="lazy"] { opacity: 1; transition: none; }
}
