:root {
  --bg-color: #050614;
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --accent-blue: #38bdf8;
  --accent-purple: #c084fc;
  --accent-cyan: #22d3ee;
  --glass-bg: rgba(15, 23, 42, 0.4);
  --glass-border: rgba(255, 255, 255, 0.06);
  --glass-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
  --card-bg: rgba(30, 41, 59, 0.3);
  --card-hover: rgba(30, 41, 59, 0.6);
}

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

body {
  background-color: var(--bg-color);
  color: var(--text-primary);
  font-family: 'Noto Sans JP', 'Inter', sans-serif;
  overflow-x: hidden;
  line-height: 1.6;
}

h1, h2, h3, .logo, .hero-title, .moon-data, .tag, .btn-primary {
  font-family: 'Outfit', sans-serif;
}

::selection {
  background: rgba(192, 132, 252, 0.3);
  color: #fff;
}

/* Background Stars Setup (Generated mostly in JS, styled here) */
#stars, #stars2, #stars3 {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
  pointer-events: none;
}
.gradient-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  background: radial-gradient(circle at 10% 20%, rgba(56, 189, 248, 0.05), transparent 45%),
              radial-gradient(circle at 90% 70%, rgba(192, 132, 252, 0.05), transparent 45%);
  pointer-events: none;
}

/* Utility / Global */
.glass-effect {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: var(--glass-shadow);
  border: 1px solid var(--glass-border);
}

.text-gradient {
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: transparent;
}

/* Navbar */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 5%;
  position: fixed;
  width: 100%;
  top: 0;
  z-index: 100;
  border-left: none;
  border-right: none;
  border-top: none;
  transition: padding 0.3s ease;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #fff;
}
.icon-moon-logo {
  width: 28px;
  height: 28px;
  color: var(--accent-purple);
  filter: drop-shadow(0 0 8px rgba(192, 132, 252, 0.6));
}

/* Moon Phase Widget */
.moon-widget {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.4rem 1.2rem;
  border-radius: 50px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--glass-border);
  box-shadow: inset 0 0 10px rgba(255, 255, 255, 0.01), 0 4px 20px rgba(0, 0, 0, 0.2);
  cursor: default;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), background 0.3s ease, box-shadow 0.3s ease;
}
.moon-widget:hover {
  transform: translateY(-2px) scale(1.02);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: inset 0 0 10px rgba(255, 255, 255, 0.03), 0 8px 30px rgba(192, 132, 252, 0.15);
}
.moon-visual {
  width: 38px;
  height: 38px;
  position: relative;
  border-radius: 50%;
  box-shadow: 0 0 10px rgba(255, 255, 240, 0.2);
  overflow: hidden;
  background-color: #050614; /* Default dark */
}
/* SVG inside visual */
.moon-visual svg {
  width: 100%;
  height: 100%;
  display: block;
}

.moon-data {
  display: flex;
  flex-direction: column;
  justify-content: center;
}
#phase-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: #fff;
  line-height: 1.2;
}
#illumination {
  font-size: 0.75rem;
  color: var(--accent-blue);
  font-weight: 500;
  margin-top: 2px;
}

/* Main Layout */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 8rem 2rem 4rem 2rem;
}

/* Hero Section */
.hero {
  text-align: center;
  margin-bottom: 5rem;
}
.hero-title {
  font-size: clamp(3rem, 6vw, 5.5rem);
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 1.5rem;
  letter-spacing: -1px;
}
.hero-subtitle {
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.8;
}

/* Tools Grid */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2.5rem;
}

/* Tool Cards */
.tool-card {
  position: relative;
  padding: 3rem 2.5rem;
  border-radius: 24px;
  background: var(--card-bg);
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
  display: flex;
  flex-direction: column;
}

.tool-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: linear-gradient(180deg, rgba(255,255,255,0.03) 0%, transparent 100%);
  z-index: 1;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.card-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 150px;
  height: 150px;
  background: rgba(192, 132, 252, 0.2);
  filter: blur(80px);
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity 0.5s ease;
  z-index: 0;
}

.tool-card:hover {
  transform: translateY(-8px);
  background: var(--card-hover);
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), 0 0 40px rgba(56, 189, 248, 0.1);
}

.tool-card:hover::before,
.tool-card:hover .card-glow {
  opacity: 1;
}

.tool-icon {
  position: relative;
  width: 56px;
  height: 56px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 2rem;
  color: var(--accent-cyan);
  z-index: 2;
  transition: transform 0.4s ease, color 0.4s ease, background 0.4s ease;
}
.tool-icon svg {
  width: 28px;
  height: 28px;
}
.tool-card:hover .tool-icon {
  transform: scale(1.1) rotate(5deg);
  color: var(--accent-purple);
  background: rgba(255, 255, 255, 0.08);
}
.tool-card:nth-child(2) .tool-icon {
  color: var(--accent-blue);
}
.tool-card:nth-child(2):hover .tool-icon {
  color: var(--accent-cyan);
}

.tool-title {
  position: relative;
  font-size: 1.8rem;
  color: #fff;
  margin-bottom: 1rem;
  z-index: 2;
}

.tool-tags {
  position: relative;
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  z-index: 2;
}
.tag {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  font-size: 0.75rem;
  color: var(--accent-blue);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.tool-desc {
  position: relative;
  color: var(--text-secondary);
  margin-bottom: 2.5rem;
  flex-grow: 1;
  z-index: 2;
  font-size: 0.95rem;
}

.tool-action {
  position: relative;
  z-index: 2;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.btn-primary, .btn-secondary {
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255,255,255,0.2);
  padding: 0.8rem 1rem;
  border-radius: 30px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  flex: 1 1 calc(50% - 0.5rem);
  min-width: 120px;
  position: relative;
  overflow: hidden;
  text-align: center;
  text-decoration: none;
  display: block;
  white-space: nowrap;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--text-secondary);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.btn-primary::after {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
  transition: left 0.5s ease;
}

.btn-primary:hover {
  background: rgba(255,255,255,0.05);
  border-color: var(--accent-purple);
  box-shadow: 0 0 15px rgba(192, 132, 252, 0.3);
}

.btn-primary:hover::after {
  left: 100%;
}

/* Footer */
.footer {
  text-align: center;
  padding: 3rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
  border-top: 1px solid var(--glass-border);
  margin-top: 4rem;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in {
  animation: fadeIn 1s ease-out forwards;
}
.slide-up {
  opacity: 0;
  animation: slideUp 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

/* Responsive */
@media (max-width: 768px) {
  .navbar {
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
  }
  .container {
    padding-top: 10rem;
    padding-left: 1rem;
    padding-right: 1rem;
  }
  .hero-title {
    font-size: 2.8rem;
  }
  .tools-grid {
    grid-template-columns: 1fr;
  }
}
