:root {
  --bg-color: #05070a;
  --text-color: #f8fafc;
  --text-muted: #94a3b8;
  --accent-color: #88aaff;
  --accent-glow: rgba(136, 170, 255, 0.5);
  --glass-bg: rgba(255, 255, 255, 0.07);
  --glass-border: rgba(255, 255, 255, 0.08);
  --font-family: 'Inter', 'Noto Sans JP', sans-serif;
}

body {
  margin: 0;
  font-family: var(--font-family);
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.6;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* --- Background Layers (Ported from dencat.dev) --- */
.bg-base { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: radial-gradient(circle at 50% 50%, #1a1c2c 0%, #05070a 100%); z-index: -3; }
.bg-image {
    position: fixed;
    top: -20px;
    left: -20px;
    width: calc(100% + 40px);
    height: calc(100% + 40px);
    background-size: cover;
    background-position: center;
    opacity: 0;
    filter: brightness(0.8) blur(15px);
    z-index: -2;
    transition: opacity 1.5s ease-in-out, transform 0.5s ease-out;
}

.bg-vignette {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(0,0,0,0) 20%, rgba(0,0,0,0.7) 100%);
    z-index: -1.5;
    pointer-events: none;
}

.bg-effect { position: fixed; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: -1; }

.particle { position: absolute; pointer-events: none; animation: fall linear infinite; }
.particle.snow { background: white; border-radius: 50%; opacity: 0.4; filter: blur(1px); }
.particle.petal { background: #ffc0cb; border-radius: 100% 0% 100% 0%; opacity: 0.6; transform: rotate(45deg); }
.particle.leaf { background: #d35400; border-radius: 100% 0% 100% 0%; opacity: 0.5; }
.particle.bubble { border: 1px solid rgba(255, 255, 255, 0.3); background: rgba(255, 255, 255, 0.1); border-radius: 50%; animation: rise linear infinite; }

@keyframes fall { from { transform: translateY(-10vh) rotate(0deg); } to { transform: translateY(110vh) rotate(360deg); } }
@keyframes rise { from { transform: translateY(110vh); opacity: 0; } 50% { opacity: 0.5; } to { transform: translateY(-10vh); opacity: 0; } }

/* --- Blog UI --- */
header {
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: var(--glass-bg);
  border-bottom: 1px solid var(--glass-border);
  padding: 1rem 2rem;
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo a {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-color);
  text-decoration: none;
  background: linear-gradient(135deg, #fff 0%, #88aaff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

nav a {
  color: var(--text-color);
  text-decoration: none;
  margin-left: 1.5rem;
  font-weight: 500;
  transition: color 0.2s ease, text-shadow 0.2s ease;
}

nav a:hover {
  color: #fff;
  text-shadow: 0 0 10px var(--accent-glow), 0 0 20px var(--accent-glow);
}

main {
  max-width: 800px;
  margin: 2rem auto;
  padding: 0 1rem;
}

.card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 0 15px var(--accent-glow);
}

.card h2 {
  margin-top: 0;
}

.card a {
  color: var(--text-color);
  text-decoration: none;
}

.card a:hover h2 {
  color: #fff;
  text-shadow: 0 0 10px var(--accent-glow);
}

.meta {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.tag {
  display: inline-block;
  background: rgba(255, 255, 255, 0.1);
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  margin-right: 0.5rem;
  color: #cbd5e1;
  text-decoration: none;
  transition: background 0.2s ease;
}

.tag:hover {
  background: var(--accent-color);
  color: #fff;
}

.post-content h1, .post-content h2, .post-content h3 {
  border-bottom: 1px solid var(--glass-border);
  padding-bottom: 0.5rem;
  margin-top: 2rem;
}

.post-content a {
  color: var(--accent-color);
  text-decoration: none;
  transition: color 0.2s ease, text-shadow 0.2s ease;
}

.post-content a:hover {
  color: #fff;
  text-decoration: underline;
  text-shadow: 0 0 8px var(--accent-glow);
}

.post-content pre {
  background: rgba(0,0,0,0.5);
  padding: 1rem;
  border-radius: 8px;
  overflow-x: auto;
  border: 1px solid var(--glass-border);
}

.post-content code {
  font-family: 'Fira Code', monospace;
  font-size: 0.9em;
}

.search-container {
  margin-bottom: 2rem;
}

#search-input {
  width: 100%;
  padding: 1rem;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  color: var(--text-color);
  font-size: 1rem;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

#search-input:hover {
  border-color: rgba(136, 170, 255, 0.4);
  box-shadow: 0 0 10px rgba(136, 170, 255, 0.3);
}

#search-input:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 15px var(--accent-glow);
}

/* --- Print Styles --- */
@media print {
  body {
    background: #fff !important;
    color: #000 !important;
    text-shadow: none !important;
  }
  
  header, nav, .search-container, .bg-base, .bg-image, .bg-vignette, .bg-effect {
    display: none !important;
  }
  
  main {
    max-width: 100% !important;
    margin: 0 !important;
    padding: 1rem !important;
    background: #fff !important;
  }
  
  .card {
    background: #fff !important;
    border: 1px solid #eee !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    margin-bottom: 2rem !important;
    break-inside: avoid;
    transform: none !important;
  }
  
  .card a, .post-content a {
    color: #000 !important;
    text-decoration: underline !important;
  }
  
  .tag {
    border: 1px solid #ddd !important;
    background: #fff !important;
    color: #000 !important;
    text-shadow: none !important;
  }
  
  .post-content h1, .post-content h2, .post-content h3 {
    border-bottom: 1px solid #eee !important;
    color: #000 !important;
  }
  
  .post-content pre {
    background: #f9f9f9 !important;
    color: #000 !important;
    border: 1px solid #eee !important;
    white-space: pre-wrap !important;
    word-break: break-all !important;
  }
  
  .meta {
    color: #666 !important;
  }
}

/* --- Footer Styles --- */
footer {
  text-align: center;
  padding: 2rem;
  margin-top: 4rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  border-top: 1px solid var(--glass-border);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  background: rgba(5, 7, 10, 0.4);
}

footer a {
  color: var(--text-muted);
  text-decoration: none;
  margin: 0 0.75rem;
  transition: color 0.2s ease, text-shadow 0.2s ease;
}

footer a:hover {
  color: var(--text-color);
  text-shadow: 0 0 8px var(--accent-glow);
}

