/* Night Sky Calendar Explorer — Styles */
:root {
  --bg-deep: #0b0f1a;
  --bg-card: #131825;
  --bg-surface: #1a2035;
  --bg-hover: #232b45;
  --border: #2a3350;
  --text-primary: #e8edf5;
  --text-secondary: #8892a8;
  --text-muted: #5a6480;
  --accent-blue: #7eb8ff;
  --accent-purple: #b08cff;
  --accent-teal: #6ee7b7;
  --accent-orange: #fbbf24;
  --accent-red: #f87171;
  --meteor: #fbbf24;
  --eclipse: #f87171;
  --planet: #7eb8ff;
  --moon: #c8e0ff;
  --easy: #6ee7b7;
  --moderate: #fbbf24;
  --hard: #f87171;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 4px 24px rgba(0,0,0,0.3);
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg-deep);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}

a { color: var(--accent-blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Header */
.site-header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.logo-text { display: flex; flex-direction: column; }
.logo-name { font-size: 1rem; font-weight: 700; color: var(--text-primary); line-height: 1.2; }
.logo-tag { font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.main-nav { display: flex; gap: 1.5rem; }
.main-nav a { color: var(--text-secondary); font-size: 0.9rem; font-weight: 500; }
.main-nav a:hover { color: var(--accent-blue); text-decoration: none; }

/* Hero */
.hero {
  max-width: 1200px;
  margin: 0 auto;
  padding: 4rem 1.5rem 3rem;
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 3rem;
  align-items: center;
}
.hero h1 {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 800;
  line-height: 1.15;
  background: linear-gradient(135deg, var(--text-primary), var(--accent-blue));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 1rem;
}
.hero-sub {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 540px;
  margin-bottom: 2rem;
}
.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  text-decoration: none;
}
.btn-primary {
  background: var(--accent-blue);
  color: var(--bg-deep);
}
.btn-primary:hover { background: #9ecfff; text-decoration: none; }
.btn-ghost {
  background: transparent;
  color: var(--accent-blue);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--bg-hover); text-decoration: none; }

/* Hero visual */
.hero-visual { display: flex; justify-content: center; }
.sky-graphic {
  width: 260px;
  height: 260px;
  background: radial-gradient(ellipse at center, #1a2540 0%, var(--bg-deep) 70%);
  border-radius: 50%;
  position: relative;
  overflow: hidden;
}
.star {
  position: absolute;
  width: 3px;
  height: 3px;
  background: #fff;
  border-radius: 50%;
  animation: twinkle 3s ease-in-out infinite;
}
.s1 { top: 20%; left: 30%; animation-delay: 0s; }
.s2 { top: 15%; left: 65%; animation-delay: 0.5s; width: 2px; height: 2px; }
.s3 { top: 45%; left: 20%; animation-delay: 1s; }
.s4 { top: 60%; left: 75%; animation-delay: 1.5s; width: 2px; height: 2px; }
.s5 { top: 35%; left: 50%; animation-delay: 0.3s; }
.s6 { top: 70%; left: 40%; animation-delay: 2s; width: 2px; height: 2px; }
.s7 { top: 25%; left: 80%; animation-delay: 0.8s; }
.s8 { top: 80%; left: 25%; animation-delay: 1.2s; width: 2px; height: 2px; }
.s9 { top: 50%; left: 85%; animation-delay: 1.8s; }
.s10 { top: 10%; left: 45%; animation-delay: 0.6s; width: 2px; height: 2px; }
.s11 { top: 55%; left: 55%; animation-delay: 2.2s; }
.s12 { top: 40%; left: 35%; animation-delay: 0.4s; width: 2px; height: 2px; }
@keyframes twinkle {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}
.moon-glow {
  position: absolute;
  top: 30%;
  left: 55%;
  width: 40px;
  height: 40px;
  background: radial-gradient(circle, rgba(200,224,255,0.4) 0%, transparent 70%);
  border-radius: 50%;
}
.meteor-trail {
  position: absolute;
  top: 25%;
  left: 20%;
  width: 60px;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(251,191,36,0.8));
  transform: rotate(-30deg);
  animation: meteor 4s ease-in infinite;
}
@keyframes meteor {
  0% { opacity: 0; transform: rotate(-30deg) translateX(-20px); }
  30% { opacity: 1; }
  60% { opacity: 0; transform: rotate(-30deg) translateX(40px); }
  100% { opacity: 0; }
}

/* Sections */
section { max-width: 1200px; margin: 0 auto; padding: 3rem 1.5rem; }
.section-header { margin-bottom: 2rem; }
.section-header h2 {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}
.section-desc { color: var(--text-secondary); max-width: 600px; }

/* Filters */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.filter-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.filter-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}
.filter-btn {
  padding: 0.4rem 0.9rem;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
}
.filter-btn:hover { background: var(--bg-hover); color: var(--text-primary); }
.filter-btn.active {
  background: var(--accent-blue);
  color: var(--bg-deep);
  border-color: var(--accent-blue);
  font-weight: 600;
}
.month-nav { margin-left: auto; }
.month-label {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  min-width: 140px;
  text-align: center;
}
.nav-btn { padding: 0.4rem 0.7rem; }

/* Calendar Grid */
.calendar-grid {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  margin-bottom: 1rem;
}
.cal-header {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background: var(--bg-surface);
  padding: 0.5rem;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}
.cal-body {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}
.cal-day {
  min-height: 90px;
  padding: 0.4rem;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  position: relative;
  cursor: default;
}
.cal-day:nth-child(7n) { border-right: none; }
.cal-day.other-month { background: rgba(0,0,0,0.15); }
.cal-day.other-month .day-num { color: var(--text-muted); opacity: 0.4; }
.cal-day.today { background: rgba(126,184,255,0.08); }
.day-num {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.2rem;
}
.cal-day.today .day-num {
  color: var(--accent-blue);
  background: var(--accent-blue);
  color: var(--bg-deep);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.day-events { display: flex; flex-direction: column; gap: 2px; }
.event-pill {
  font-size: 0.65rem;
  padding: 1px 5px;
  border-radius: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  transition: opacity 0.2s;
}
.event-pill:hover { opacity: 0.8; }
.event-pill.meteor { background: rgba(251,191,36,0.2); color: var(--meteor); }
.event-pill.eclipse { background: rgba(248,113,113,0.2); color: var(--eclipse); }
.event-pill.planet { background: rgba(126,184,255,0.2); color: var(--planet); }
.event-pill.moon { background: rgba(200,224,255,0.2); color: var(--moon); }

/* Event Detail Panel */
.event-detail-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 420px;
  max-width: 100%;
  height: 100vh;
  background: var(--bg-card);
  border-left: 1px solid var(--border);
  box-shadow: -8px 0 32px rgba(0,0,0,0.4);
  z-index: 200;
  overflow-y: auto;
  padding: 2rem;
  transform: translateX(100%);
  transition: transform 0.3s ease;
}
.event-detail-panel:not([hidden]) { transform: translateX(0); }
.panel-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0.3rem;
}
.panel-close:hover { color: var(--text-primary); }
.panel-content h3 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  padding-right: 2rem;
}
.panel-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}
.panel-tag {
  font-size: 0.75rem;
  padding: 0.25rem 0.7rem;
  border-radius: 20px;
  font-weight: 600;
}
.panel-tag.type { background: rgba(126,184,255,0.15); color: var(--accent-blue); }
.panel-tag.diff { background: rgba(110,231,183,0.15); color: var(--easy); }
.panel-tag.diff.moderate { background: rgba(251,191,36,0.15); color: var(--moderate); }
.panel-tag.diff.hard { background: rgba(248,113,113,0.15); color: var(--hard); }
.panel-tag.equip { background: rgba(176,140,255,0.15); color: var(--accent-purple); }
.panel-desc { color: var(--text-secondary); margin-bottom: 1.5rem; line-height: 1.7; }
.panel-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.panel-detail-item {
  background: var(--bg-surface);
  padding: 0.8rem;
  border-radius: var(--radius-sm);
}
.panel-detail-item label {
  display: block;
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.2rem;
}
.panel-detail-item span { font-size: 0.95rem; font-weight: 600; }
.panel-tips { margin-top: 1rem; }
.panel-tips h4 { font-size: 0.9rem; color: var(--accent-blue); margin-bottom: 0.5rem; }
.panel-tips ul { padding-left: 1.2rem; color: var(--text-secondary); }
.panel-tips li { margin-bottom: 0.3rem; font-size: 0.9rem; }

/* Legend */
.calendar-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1rem;
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
}
.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}
.dot.meteor { background: var(--meteor); }
.dot.eclipse { background: var(--eclipse); }
.dot.planet { background: var(--planet); }
.dot.moon { background: var(--moon); }
.dot.easy { background: var(--easy); }
.dot.moderate { background: var(--moderate); }
.dot.hard { background: var(--hard); }

/* Print bar */
.print-bar {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
}

/* Equipment Section */
.equipment-section { background: var(--bg-card); margin: 0; max-width: 100%; }
.equipment-section .section-header,
.equipment-section .tier-grid { max-width: 1200px; margin-left: auto; margin-right: auto; padding-left: 1.5rem; padding-right: 1.5rem; }
.equipment-section .section-header { padding-top: 3rem; }
.tier-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  padding-bottom: 3rem;
}
.tier-card {
  background: var(--bg-deep);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: border-color 0.2s;
}
.tier-card:hover { border-color: var(--accent-blue); }
.tier-icon { font-size: 2rem; margin-bottom: 0.5rem; }
.tier-card h3 { font-size: 1.1rem; margin-bottom: 0.2rem; }
.tier-cost { color: var(--text-muted); font-size: 0.85rem; margin-bottom: 1rem; }
.tier-list { padding-left: 1.2rem; color: var(--text-secondary); margin-bottom: 1rem; }
.tier-list li { margin-bottom: 0.3rem; font-size: 0.9rem; }
.tier-note { font-size: 0.85rem; color: var(--text-muted); font-style: italic; }

/* Tips Section */
.tips-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3rem;
}
.tip-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}
.tip-card h3 { font-size: 1rem; color: var(--accent-blue); margin-bottom: 0.5rem; }
.tip-card p { color: var(--text-secondary); font-size: 0.9rem; }

/* FAQ */
.faq-block {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}
.faq-block h3 { font-size: 1.1rem; margin-bottom: 1rem; }
.faq-block details {
  border-bottom: 1px solid var(--border);
  padding: 0.8rem 0;
}
.faq-block details:last-child { border-bottom: none; }
.faq-block summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.95rem;
}
.faq-block summary:hover { color: var(--accent-blue); }
.faq-block details p { color: var(--text-secondary); font-size: 0.9rem; padding-top: 0.5rem; padding-left: 0.5rem; }

/* Why section */
.why-content p { color: var(--text-secondary); margin-bottom: 1rem; max-width: 700px; }
.last-updated { font-size: 0.8rem; color: var(--text-muted); margin-top: 1.5rem; }

/* Footer */
.site-footer {
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  margin-top: 2rem;
}
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}
.footer-links { display: flex; gap: 1.5rem; }
.footer-links a { color: var(--text-secondary); font-size: 0.85rem; }
.footer-links a:hover { color: var(--accent-blue); }
.footer-copy { font-size: 0.8rem; color: var(--text-muted); }
.footer-copy a { color: var(--text-secondary); }

/* Responsive */
@media (max-width: 768px) {
  .hero { grid-template-columns: 1fr; padding: 2.5rem 1rem 2rem; }
  .hero-visual { display: none; }
  .header-inner { flex-direction: column; padding: 0.6rem 1rem; }
  .main-nav { gap: 1rem; }
  .filters { flex-direction: column; }
  .month-nav { margin-left: 0; }
  .cal-day { min-height: 60px; padding: 0.2rem; }
  .event-pill { font-size: 0.55rem; padding: 1px 3px; }
  .event-detail-panel { width: 100%; padding: 1.5rem; }
  .panel-detail-grid { grid-template-columns: 1fr; }
  .tier-grid, .tips-grid { grid-template-columns: 1fr; }
  .footer-inner { flex-direction: column; text-align: center; }
}

@media print {
  .site-header, .filters, .print-bar, .hero-visual, .site-footer, .event-detail-panel, .tips-section, .why-section { display: none !important; }
  body { background: #fff; color: #000; }
  .calendar-grid { border: 1px solid #ccc; }
  .cal-day { border: 1px solid #ddd; min-height: 70px; }
  .event-pill { color: #333 !important; border: 1px solid #999; }
}



/* Factory-injected deployment helpers. The AI owns the site design above this block. */
.ad-unit {
  width: min(100%, 720px);
  min-height: 120px;
  margin: 24px auto;
  display: block;
}

.legal-page {
  width: min(900px, calc(100% - 32px));
  margin: 40px auto;
}

.factory-fallback-nav {
  width: min(900px, calc(100% - 32px));
  margin: 24px auto 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  font-size: 0.95rem;
}

.factory-fallback-nav a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
}
