:root {
  --bg-deep: #0a0715;
  --bg-panel: rgba(28, 20, 48, 0.55);
  --border: rgba(255, 255, 255, 0.09);
  --text-primary: #f1eefb;
  --text-muted: #b3a9cf;
  --accent: #e8c766;
  --accent-2: #9c7bea;
  --accent-soft: rgba(232, 199, 102, 0.14);
  --fire: #e8734a;
  --earth: #7fae6a;
  --air: #7ec8e3;
  --water: #6a8fd8;
}

:root[data-theme="light"] {
  --bg-deep: #f4f1fb;
  --bg-panel: rgba(255, 255, 255, 0.7);
  --border: rgba(20, 10, 40, 0.1);
  --text-primary: #201a35;
  --text-muted: #5c5478;
  --accent: #b6862c;
  --accent-2: #6d4bc9;
  --accent-soft: rgba(182, 134, 44, 0.12);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: radial-gradient(ellipse at top, #241a44 0%, #0a0715 55%, #050309 100%);
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  overflow-x: hidden;
  transition: background 0.3s ease, color 0.3s ease;
}

:root[data-theme="light"] body {
  background: radial-gradient(ellipse at top, #ded4f7 0%, #f4f1fb 55%, #ffffff 100%);
}

#stars {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  background: rgba(10, 7, 21, 0.65);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

:root[data-theme="light"] .site-header {
  background: rgba(244, 241, 251, 0.75);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.02em;
}

.brand-glyph { color: var(--accent); }

.site-nav {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.site-nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s ease;
}

.site-nav a:hover { color: var(--accent); }

.theme-toggle {
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  border-radius: 999px;
  width: 38px;
  height: 38px;
  cursor: pointer;
  font-size: 1rem;
  color: var(--text-primary);
}

main {
  position: relative;
  z-index: 1;
  max-width: 1000px;
  margin: 0 auto;
  padding: 3rem 1.5rem 4rem;
}

.hero {
  text-align: center;
  margin-bottom: 3rem;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.75rem;
  color: var(--accent);
  margin: 0 0 0.75rem;
}

.hero h1 {
  font-size: clamp(2.25rem, 5vw, 3.5rem);
  margin: 0 0 0.75rem;
  font-weight: 700;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.tagline {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 520px;
  margin: 0 auto;
  line-height: 1.6;
}

.panel {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2rem;
  margin-bottom: 1.75rem;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  scroll-margin-top: 5.5rem;
}

.panel h2 {
  margin: 0 0 0.35rem;
  font-size: 1.4rem;
  font-weight: 700;
}

.section-sub {
  color: var(--text-muted);
  margin: 0 0 1.5rem;
  font-size: 0.92rem;
}

.finder-row {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

input[type="date"], select {
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 0.65rem 0.9rem;
  border-radius: 10px;
  font-size: 0.95rem;
  flex: 1;
  min-width: 160px;
}

button {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border: none;
  color: #14101f;
  font-weight: 700;
  padding: 0.65rem 1.3rem;
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.95rem;
  transition: opacity 0.2s ease, transform 0.15s ease;
}

button:hover { opacity: 0.9; transform: translateY(-1px); }

.finder-result {
  margin-top: 1.25rem;
  padding: 1.25rem;
  background: var(--accent-soft);
  border: 1px solid rgba(232, 199, 102, 0.25);
  border-radius: 14px;
  line-height: 1.6;
}

.sign-grid, .planet-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1rem;
}

.sign-card, .planet-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.1rem;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease;
  text-align: center;
}

.sign-card:hover, .planet-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
}

.sign-symbol, .planet-symbol {
  font-size: 1.8rem;
  display: block;
  margin-bottom: 0.4rem;
  color: var(--accent);
}

.sign-card h3, .planet-card h3 {
  margin: 0 0 0.25rem;
  font-size: 1rem;
}

.sign-card .dates, .planet-card .governs {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin: 0 0 0.4rem;
}

.element-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
}

.element-Fire { background: rgba(232, 115, 74, 0.18); color: var(--fire); }
.element-Earth { background: rgba(127, 174, 106, 0.18); color: var(--earth); }
.element-Air { background: rgba(126, 200, 227, 0.18); color: var(--air); }
.element-Water { background: rgba(106, 143, 216, 0.18); color: var(--water); }

.compat-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.compat-and {
  color: var(--accent);
  font-weight: 700;
  font-size: 1.1rem;
}

.compat-result {
  margin-top: 1.5rem;
}

.compat-meter {
  height: 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  overflow: hidden;
  margin-bottom: 0.75rem;
}

.compat-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
  width: 0%;
  transition: width 0.6s ease;
}

.compat-score {
  font-weight: 700;
  color: var(--accent);
  margin: 0 0 0.4rem;
}

.compat-blurb {
  color: var(--text-muted);
  margin: 0;
  line-height: 1.6;
}

footer {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  padding-top: 1.5rem;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: rgba(5, 3, 9, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.modal[hidden] { display: none; }

.modal-card {
  position: relative;
  max-width: 480px;
  width: 100%;
  background: var(--bg-deep);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 2rem;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.modal-close {
  position: absolute;
  top: 0.9rem;
  right: 0.9rem;
  background: rgba(255,255,255,0.08);
  border: none;
  color: var(--text-primary);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
}

.modal-card h3 {
  margin: 0.5rem 0 0.25rem;
  font-size: 1.4rem;
}

.modal-card .dates {
  color: var(--text-muted);
  margin: 0 0 1rem;
}

.modal-card p {
  line-height: 1.65;
  color: var(--text-primary);
}

.modal-symbol {
  font-size: 2.5rem;
  color: var(--accent);
}

@media (max-width: 640px) {
  .site-nav { display: none; }
}
