:root {
  --text: #f5f5f7;
  --text-2: rgba(245, 245, 247, 0.7);
  --text-3: rgba(245, 245, 247, 0.45);
  --accent: #6366f1;
  --accent-light: #818cf8;
  --accent-glow: rgba(99, 102, 241, 0.3);
  --bg: #09090b;
  --bg-elevated: rgba(255, 255, 255, 0.03);
  --bg-card: rgba(255, 255, 255, 0.04);
  --border: rgba(255, 255, 255, 0.06);
  --border-light: rgba(255, 255, 255, 0.1);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Display", "Hiragino Sans", "Noto Sans JP", sans-serif;
  --mono: "SF Mono", "Fira Code", "JetBrains Mono", monospace;
  --ease: cubic-bezier(0.25, 0.1, 0.25, 1);
  --radius: 16px;
  --radius-lg: 24px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  color: var(--text);
  line-height: 1.6;
  letter-spacing: -0.011em;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: var(--bg);
  overflow-x: hidden;
}

/* Subtle grid background */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: 
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
  z-index: 0;
}

/* Ambient glow */
.ambient {
  position: fixed;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  filter: blur(150px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.4;
}

.ambient-1 {
  background: var(--accent);
  top: -200px;
  right: -100px;
  opacity: 0.15;
}

.ambient-2 {
  background: #8b5cf6;
  bottom: -200px;
  left: -100px;
  opacity: 0.1;
}

/* Shell */
.shell {
  position: relative;
  z-index: 1;
  max-width: 680px;
  margin: 0 auto;
  padding: 0 1.5rem 8rem;
}

/* Header */
.header {
  padding: 3rem 0 2rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 3rem;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.logo:hover {
  color: var(--accent-light);
  text-decoration: none;
}

/* Navigation */
.nav {
  display: flex;
  gap: 0.25rem;
  padding: 0.25rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 100px;
}

.nav a {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-3);
  text-decoration: none;
  padding: 0.5rem 0.875rem;
  border-radius: 100px;
  transition: all 0.15s var(--ease);
}

.nav a:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  text-decoration: none;
}

/* Hero */
.hero {
  padding: 4rem 0 3rem;
  text-align: center;
}

.hero h1 {
  font-size: clamp(2.5rem, 6vw, 3.5rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.1;
  color: var(--text);
  margin-bottom: 0.75rem;
}

.hero .subtitle {
  font-size: 1.125rem;
  color: var(--text-3);
  font-weight: 400;
}

/* Card */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  margin-bottom: 1rem;
  transition: all 0.2s var(--ease);
}

.card:hover {
  border-color: var(--border-light);
  background: rgba(255, 255, 255, 0.06);
}

.card h2 {
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.3;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.card h2 a {
  color: inherit;
  text-decoration: none;
}

.card h2 a:hover {
  color: var(--accent-light);
}

.card h3 {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
  margin: 1.5rem 0 0.5rem;
}

.card p {
  font-size: 0.9375rem;
  color: var(--text-2);
  line-height: 1.65;
  margin-bottom: 0.5rem;
}

.card p:last-child { margin-bottom: 0; }

.card strong {
  color: var(--text);
  font-weight: 600;
}

.card ul, .card ol {
  margin: 0.5rem 0 0.5rem 1.25rem;
  color: var(--text-2);
  font-size: 0.9375rem;
}

.card li {
  margin-bottom: 0.3rem;
  line-height: 1.55;
}

/* Post meta */
.post-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  color: var(--text-3);
  margin-bottom: 0.5rem;
}

.post-meta time {
  color: var(--text-3);
}

.post-meta .category {
  color: var(--accent-light);
  font-weight: 500;
}

.post-meta .separator {
  color: var(--text-3);
  opacity: 0.5;
}

/* Tags */
.tag {
  display: inline-flex;
  align-items: center;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-3);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  padding: 0.25rem 0.625rem;
  border-radius: 100px;
  text-decoration: none;
  margin-right: 0.375rem;
  margin-bottom: 0.375rem;
  transition: all 0.15s var(--ease);
}

.tag:hover {
  color: var(--accent-light);
  border-color: var(--accent);
  background: rgba(99, 102, 241, 0.1);
  text-decoration: none;
}

/* Post content */
.post-content {
  line-height: 1.75;
  color: var(--text-2);
  font-size: 1rem;
}

.post-content > * + * {
  margin-top: 1.25rem;
}

.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4,
.post-content h5,
.post-content h6 {
  color: var(--text);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.3;
}

.post-content h1 { font-size: 1.75rem; margin-top: 2.5rem; }
.post-content h2 { font-size: 1.375rem; margin-top: 2.5rem; }
.post-content h3 { font-size: 1.125rem; margin-top: 2rem; }

.post-content p {
  margin-bottom: 0;
}

.post-content img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
  margin: 1.5rem 0;
}

.post-content pre {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  overflow-x: auto;
  font-size: 0.875rem;
  line-height: 1.7;
}

.post-content code {
  font-family: var(--mono);
  font-size: 0.875em;
}

.post-content :not(pre) > code {
  background: rgba(99, 102, 241, 0.15);
  color: var(--accent-light);
  padding: 0.15em 0.4em;
  border-radius: 6px;
  font-size: 0.875em;
}

.post-content a {
  color: var(--accent-light);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: rgba(129, 140, 248, 0.4);
  transition: text-decoration-color 0.15s;
}

.post-content a:hover {
  text-decoration-color: var(--accent-light);
}

.post-content blockquote {
  border-left: 2px solid var(--accent);
  padding-left: 1rem;
  color: var(--text-3);
  font-style: italic;
}

.post-content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2.5rem 0;
}

.post-content input[type="checkbox"] {
  margin-right: 0.5rem;
  accent-color: var(--accent);
}

/* Post navigation */
.post-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 4rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  gap: 1rem;
}

.post-nav a {
  color: var(--text-3);
  text-decoration: none;
  font-size: 0.875rem;
  transition: color 0.15s var(--ease);
}

.post-nav a:hover {
  color: var(--text);
}

.post-nav .next {
  text-align: right;
  margin-left: auto;
}

/* Page title */
.page-title {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.035em;
  color: var(--text);
  margin-bottom: 2rem;
}

/* Search box */
.search-box {
  margin-bottom: 2rem;
}

.search-box input {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.9375rem;
  font-family: var(--font);
  transition: all 0.15s var(--ease);
}

.search-box input::placeholder {
  color: var(--text-3);
}

.search-box input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

/* Category list */
.category-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75rem;
}

.category-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  text-decoration: none;
  color: var(--text);
  transition: all 0.15s var(--ease);
}

.category-card:hover {
  border-color: var(--border-light);
  background: rgba(255, 255, 255, 0.06);
  text-decoration: none;
}

.category-card h3 {
  margin-bottom: 0.25rem;
  font-size: 1rem;
}

.category-card .count {
  color: var(--text-3);
  font-size: 0.8125rem;
}

/* Posts list */
.posts-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* View all link */
.view-all {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  margin-top: 1.5rem;
  color: var(--text-3);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: color 0.15s var(--ease);
}

.view-all:hover {
  color: var(--accent-light);
}

.view-all::after {
  content: '→';
  transition: transform 0.15s var(--ease);
}

.view-all:hover::after {
  transform: translateX(3px);
}

/* Post header */
.post-header {
  margin-bottom: 2.5rem;
}

.post-header h1 {
  font-size: clamp(1.75rem, 5vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.2;
  color: var(--text);
  margin-bottom: 0.75rem;
}

.post-header .post-meta {
  margin-bottom: 0.75rem;
}

.post-header .post-tags {
  margin-top: 0.5rem;
}

/* 404 page */
.not-found {
  text-align: center;
  padding: 6rem 1rem;
}

.not-found h1 {
  font-size: 5rem;
  font-weight: 700;
  color: var(--text-3);
  margin-bottom: 0.5rem;
}

.not-found p {
  color: var(--text-3);
  font-size: 1rem;
  margin-bottom: 1.5rem;
}

.not-found a {
  color: var(--accent-light);
}

/* Footer */
.footer {
  text-align: center;
  padding: 3rem 0 2rem;
  margin-top: 2rem;
  border-top: 1px solid var(--border);
  position: relative;
  z-index: 1;
}

.footer p {
  font-size: 0.8125rem;
  color: var(--text-3);
  margin-bottom: 0.25rem;
}

.footer .brand {
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 0.375rem;
}

/* Link styles */
a {
  color: var(--accent-light);
}

/* Responsive */
@media (max-width: 640px) {
  .shell { padding: 0 1rem 6rem; }
  .header { padding: 2rem 0 1.5rem; }
  .header-inner { flex-direction: column; gap: 1rem; }
  .hero { padding: 3rem 0 2rem; }
  .hero h1 { font-size: 2rem; }
  
  .nav {
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
  }
  
  .nav a {
    padding: 0.4rem 0.625rem;
    font-size: 0.75rem;
  }
  
  .card {
    padding: 1.25rem;
    border-radius: var(--radius);
  }
  
  .post-nav {
    flex-direction: column;
    gap: 1rem;
  }
  
  .post-nav .next {
    text-align: left;
  }
}
