/* Reset & Base */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #f8f9fa;
  --surface: #ffffff;
  --accent: #6c63ff;
  --accent-dark: #5a52d5;
  --text: #1a1a2e;
  --text-muted: #6b7280;
  --border: #e5e7eb;
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-hover: 0 6px 20px rgba(108,99,255,0.15);
  --radius: 12px;
  --font: 'Inter', system-ui, -apple-system, sans-serif;
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

img { max-width: 100%; height: auto; display: block; }

/* Layout */
.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

main { flex: 1; }

/* Header */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  max-width: 1100px;
  margin: 0 auto;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
}

.site-logo img {
  flex-shrink: 0;
  height: 28px;
  width: auto;
}

.site-nav {
  display: flex;
  gap: 6px;
}

.site-nav a {
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: background 0.15s, color 0.15s;
}

.site-nav a:hover,
.site-nav a.active {
  background: #f0eeff;
  color: var(--accent);
}

/* Hero */
.hero {
  padding: 72px 20px 56px;
  text-align: center;
}

.hero h1 {
  font-size: clamp(1.9rem, 5vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 16px;
  color: var(--text);
}

.hero h1 span {
  color: var(--accent);
}

.hero-sub {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 520px;
  margin: 0 auto;
}

/* Tools section */
.tools-section {
  padding-bottom: 64px;
}

/* Category section */
.category-section {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.category-section-header {
  background: #f0eeff;
  border-bottom: 1px solid #e4e0ff;
  padding: 20px 24px;
}

h2.category-section-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.category-icon {
  font-size: 1.3rem;
  line-height: 1;
}

.category-section-heading a {
  color: var(--text);
}

.category-section-heading a:hover {
  color: var(--accent);
}

.category-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
  padding-left: 36px;
}

.category-tools {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px 24px;
  background: var(--surface);
}

.category-tools li a {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--accent);
  padding: 6px 10px;
  border-radius: 8px;
  background: #f9f8ff;
  transition: background 0.15s;
}

.category-tools li a:hover {
  background: #eeebff;
  color: var(--accent-dark);
}

.category-tools li a::before {
  content: '→';
  font-size: 0.8rem;
  opacity: 0.7;
}

/* Footer */
.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 28px 20px;
  text-align: center;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.footer-links {
  display: flex;
  gap: 16px;
}

.footer-links a {
  color: var(--text-muted);
  font-size: 0.875rem;
}

.footer-links a:hover {
  color: var(--accent);
}

/* Breadcrumb */
.breadcrumb {
  padding: 14px 0;
  font-size: 0.85rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb .sep { opacity: 0.5; }
.breadcrumb .current { color: var(--text); font-weight: 500; }

/* Page header (inner pages) */
.page-hero {
  padding: 48px 0 36px;
}

.page-hero h1 {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 10px;
}

.page-hero .sub {
  font-size: 1rem;
  color: var(--text-muted);
  max-width: 560px;
}

/* Tools list within category page */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  padding: 8px 0 56px;
}

.tool-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: box-shadow 0.2s, transform 0.2s;
  color: inherit;
}

.tool-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

.tool-card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  transition: color 0.15s;
}

.tool-card:hover .tool-card-title { color: var(--accent); }

.tool-card p {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ==================== MOON PHASE PAGE ==================== */

/* Sky section */
.sky-section {
  background: #0d1117;
  width: 100%;
  padding: 48px 20px 40px;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.stars-canvas {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.moon-wrapper {
  position: relative;
  z-index: 2;
}

#moon-svg {
  display: block;
  width: 220px;
  height: 220px;
  filter: drop-shadow(0 0 8px rgba(255,235,160,0.3));
  transition: filter 0.6s ease;
}

#moon-svg.moon--full {
  filter:
    drop-shadow(0 0 18px rgba(255,235,160,0.9))
    drop-shadow(0 0 50px rgba(255,210,80,0.5))
    drop-shadow(0 0 100px rgba(200,160,40,0.2));
}

.moon-phase-info {
  position: relative;
  z-index: 2;
  text-align: center;
  color: #f0f0f0;
}

.phase-name {
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin-bottom: 8px;
  text-shadow: 0 2px 12px rgba(0,0,0,0.6);
}

.phase-direction {
  font-size: 1.05rem;
  opacity: 0.8;
}

/* Moon content */
.moon-content {
  padding: 48px 0 64px;
}

.moon-page-title {
  font-size: 1.6rem;
  font-weight: 800;
  margin: 24px 0 32px;
  letter-spacing: -0.02em;
}

.full-moons-section {
  margin-bottom: 48px;
}

.full-moons-section h2 {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 20px;
}

.full-moons-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 420px;
}

.full-moons-list li {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
  transition: border-color 0.15s;
}

.full-moons-list li.next-full-moon {
  border-color: var(--accent);
  background: #f0eeff;
  font-weight: 600;
  color: var(--accent-dark);
}

.full-moons-list li .moon-icon {
  font-size: 1.1rem;
  margin-right: 4px;
}

/* SEO text */
.seo-text {
  max-width: 700px;
}

.seo-text h2 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.seo-text p {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.75;
}

/* About / Privacy pages */
.prose-page {
  max-width: 720px;
  padding: 48px 20px 80px;
}

.prose-page h1 {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.prose-page .updated {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 32px;
}

.prose-page h2 {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 32px 0 10px;
  color: var(--text);
}

.prose-page p {
  font-size: 0.975rem;
  color: var(--text-muted);
  line-height: 1.8;
  margin-bottom: 14px;
}

.prose-page a { color: var(--accent); }
.prose-page a:hover { text-decoration: underline; }

/* Responsive */
@media (max-width: 600px) {
  .header-inner { padding: 12px 16px; }
  .site-logo { font-size: 1rem; }
  .hero { padding: 48px 16px 40px; }
  .tools-section { padding-bottom: 48px; }
  .moon-content { padding: 32px 16px 48px; }
  .phase-name { font-size: 1.4rem; }
  .footer-inner { flex-direction: column; text-align: center; }
}

@media (max-width: 380px) {
  .header-inner { padding: 10px 14px; gap: 10px; }
  .site-logo { font-size: 0.95rem; gap: 8px; }
  .site-logo img { height: 25px; }
  .site-nav { gap: 4px; }
  .site-nav a { padding: 5px 10px; font-size: 0.85rem; }
}
