:root {
  --color-primary: #1E40AF;
  --color-primary-light: #3B82F6;
  --color-accent: #4f46e5;
  --color-accent-light: #818CF8;
  --color-text: #0f172a;
  --color-text-muted: #475569;
  --color-bg: #ffffff;
  --color-bg-alt: #EEF2FF;
  --color-border: #e2e8f0;
  --color-success: #10b981;
  --font-sans: 'Inter', 'Noto Sans JP', -apple-system, BlinkMacSystemFont, sans-serif;
  --max-width: 1100px;
  --content-width: 740px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.8;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; }

/* Header */
.header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--color-border);
}
.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 16px 24px;
  display: flex; justify-content: space-between; align-items: center;
}
.logo {
  display: flex; align-items: center; gap: 10px;
  font-weight: 800; font-size: 22px; letter-spacing: -0.02em;
}
.logo-icon { width: 32px; height: 32px; }
.logo-text {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.nav { display: flex; align-items: center; gap: 32px; }
.nav-link {
  font-size: 14px; font-weight: 500;
  color: var(--color-text-muted);
  transition: color 0.2s;
}
.nav-link:hover { color: var(--color-text); }
.nav-cta {
  padding: 10px 24px;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-accent) 100%);
  color: white;
  border-radius: 8px;
  font-size: 14px; font-weight: 600;
  transition: opacity 0.2s, transform 0.2s;
}
.nav-cta:hover { opacity: 0.9; transform: translateY(-1px); }
.mobile-menu-btn {
  display: none; flex-direction: column; gap: 5px;
  background: none; border: none; cursor: pointer; padding: 4px;
}
.mobile-menu-btn span {
  width: 24px; height: 2px;
  background: var(--color-text); transition: 0.2s;
}

/* Page hero */
.page-hero {
  padding: 140px 24px 60px;
  background: linear-gradient(135deg, #1e3a5f 0%, #1E40AF 40%, #4338CA 70%, #6366F1 100%);
  color: white;
}
.page-hero-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}
.page-hero-eyebrow {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.75);
  margin-bottom: 16px;
}
.page-hero h1 {
  font-size: clamp(28px, 4.2vw, 42px);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.4;
  max-width: 880px;
}
.page-hero-meta {
  margin-top: 20px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
  display: flex; gap: 16px; flex-wrap: wrap;
}

/* Article layout */
.article-wrap {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 56px 24px 80px;
}
.article-back {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 500;
  color: var(--color-text-muted);
  margin-bottom: 32px;
  transition: color 0.2s;
}
.article-back:hover { color: var(--color-primary); }

/* Prose */
.prose { color: var(--color-text); font-size: 16.5px; line-height: 1.9; }
.prose > * + * { margin-top: 1.1em; }
.prose h2 {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--color-text);
  margin-top: 56px;
  padding-bottom: 12px;
  border-bottom: 3px solid var(--color-accent);
}
.prose h3 {
  font-size: 19px;
  font-weight: 700;
  color: var(--color-text);
  margin-top: 36px;
}
.prose h4 {
  font-size: 16px;
  font-weight: 700;
  color: var(--color-text);
  margin-top: 28px;
}
.prose p { color: var(--color-text); }
.prose ul, .prose ol { padding-left: 24px; }
.prose li { margin-bottom: 6px; }
.prose li > p { margin: 0; }
.prose strong { color: var(--color-text); font-weight: 700; }
.prose a {
  color: var(--color-primary);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(30, 64, 175, 0.3);
  transition: text-decoration-color 0.2s;
}
.prose a:hover { text-decoration-color: var(--color-primary); }
.prose hr {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 48px 0;
}
.prose blockquote {
  border-left: 4px solid var(--color-accent);
  padding: 4px 20px;
  background: var(--color-bg-alt);
  border-radius: 0 8px 8px 0;
  color: var(--color-text);
  font-size: 15px;
}
.prose code {
  padding: 2px 6px;
  background: #f1f5f9;
  border-radius: 4px;
  font-size: 13px;
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
  color: var(--color-accent);
}
.prose pre {
  background: #1e293b;
  color: #e2e8f0;
  border-radius: 10px;
  padding: 20px 24px;
  overflow-x: auto;
  font-size: 13px;
  line-height: 1.7;
}
.prose pre code {
  background: none;
  padding: 0;
  color: inherit;
  font-size: inherit;
}
.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14.5px;
}
.prose th, .prose td {
  padding: 12px 14px;
  border: 1px solid var(--color-border);
  text-align: left;
  vertical-align: top;
}
.prose th {
  background: var(--color-bg-alt);
  font-weight: 700;
  color: var(--color-text);
}
.prose td { color: var(--color-text); }
.prose li { line-height: 1.85; }
.prose li + li { margin-top: 4px; }

/* Inline diagram */
.prose figure.diagram {
  margin: 40px 0;
  padding: 28px 24px 20px;
  background: var(--color-bg-alt);
  border-radius: 14px;
  border: 1px solid #e0e7ff;
}
.prose figure.diagram svg {
  display: block;
  width: 100%;
  height: auto;
  max-width: 720px;
  margin: 0 auto;
}
.prose figure.diagram figcaption {
  margin-top: 16px;
  text-align: center;
  font-size: 13px;
  color: var(--color-text-muted);
  line-height: 1.7;
}

/* Screenshot figure */
.prose figure.screenshot {
  margin: 32px 0;
  text-align: center;
}
.prose figure.screenshot img {
  display: block;
  width: 100%;
  height: auto;
  margin: 0 auto;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  box-shadow: 0 8px 24px -16px rgba(15, 23, 42, 0.18);
}
.prose figure.screenshot.is-narrow img {
  max-width: 480px;
}
.prose figure.screenshot figcaption {
  margin-top: 12px;
  text-align: center;
  font-size: 13px;
  color: var(--color-text-muted);
  line-height: 1.7;
}

/* CTA card embedded in article */
.cta-card {
  margin: 48px 0;
  padding: 32px;
  border-radius: 16px;
  background: linear-gradient(135deg, #1e3a5f 0%, #1E40AF 50%, #4338CA 100%);
  color: white;
  text-align: center;
  box-shadow: 0 20px 40px -20px rgba(30, 64, 175, 0.4);
}
.cta-card h3 {
  color: white;
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 10px;
  letter-spacing: -0.01em;
}
.cta-card p {
  color: rgba(255, 255, 255, 0.85);
  font-size: 14.5px;
  margin-bottom: 22px;
  line-height: 1.7;
}
.cta-card-actions {
  display: inline-flex; gap: 12px; flex-wrap: wrap; justify-content: center;
}
.cta-card .cta-card-btn {
  display: inline-block;
  padding: 12px 26px;
  background: white;
  color: var(--color-primary);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  transition: transform 0.2s, box-shadow 0.2s;
}
.cta-card .cta-card-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px -8px rgba(0, 0, 0, 0.3);
  text-decoration: none;
}
.cta-card .cta-card-btn-secondary {
  background: rgba(255, 255, 255, 0.12);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.3);
}
.cta-card .cta-card-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Index page */
.posts-grid {
  display: grid;
  gap: 20px;
}
.post-card {
  display: block;
  padding: 28px;
  background: white;
  border: 1px solid var(--color-border);
  border-radius: 14px;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.post-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px -16px rgba(15, 23, 42, 0.18);
  border-color: var(--color-accent-light);
}
.post-card-meta {
  font-size: 12px;
  color: var(--color-text-muted);
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}
.post-card-title {
  font-size: 19px;
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: -0.01em;
  line-height: 1.5;
  margin-bottom: 10px;
}
.post-card-desc {
  font-size: 14.5px;
  color: var(--color-text-muted);
  line-height: 1.7;
}
.posts-empty {
  padding: 48px;
  border: 1px dashed var(--color-border);
  border-radius: 12px;
  text-align: center;
  color: var(--color-text-muted);
  font-size: 14px;
}

/* Footer */
.footer {
  background: #0a1628;
  color: rgba(255, 255, 255, 0.6);
  padding: 48px 24px;
}
.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex; justify-content: space-between; align-items: center;
}
.footer-logo {
  display: flex; align-items: center; gap: 10px;
  font-weight: 800; font-size: 18px; color: white;
}
.footer-links { display: flex; gap: 24px; flex-wrap: wrap; }
.footer-links a {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.5);
  transition: color 0.2s;
}
.footer-links a:hover { color: white; }
.footer-bottom {
  max-width: var(--max-width);
  margin: 24px auto 0;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex; justify-content: space-between; align-items: center;
}
.footer-copy { font-size: 13px; color: rgba(255, 255, 255, 0.6); }
.footer-company { font-size: 12px; color: rgba(255, 255, 255, 0.6); }
.footer-company a {
  color: rgba(255, 255, 255, 0.5);
  text-decoration: underline;
}
.footer-company a:hover { color: white; }

/* Responsive */
@media (max-width: 640px) {
  .nav {
    display: none;
    position: absolute; top: 100%; left: 0; right: 0;
    background: white;
    flex-direction: column;
    padding: 24px;
    gap: 16px;
    border-bottom: 1px solid var(--color-border);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
  }
  .nav.nav-open { display: flex; }
  .nav-cta { text-align: center; }
  .mobile-menu-btn { display: flex; }
  .mobile-menu-btn.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
  .mobile-menu-btn.active span:nth-child(2) { opacity: 0; }
  .mobile-menu-btn.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }
  .page-hero { padding: 120px 24px 48px; }
  .article-wrap { padding: 40px 20px 64px; }
  .prose { font-size: 16px; line-height: 1.95; }
  .prose > * + * { margin-top: 1.2em; }
  .prose h2 { font-size: 22px; margin-top: 48px; padding-bottom: 10px; }
  .prose h3 { font-size: 17px; margin-top: 32px; }
  .prose li { line-height: 1.9; }
  .prose figure.diagram { padding: 20px 14px 14px; margin: 32px 0; }
  .prose figure.screenshot { margin: 24px 0; }
  .prose figure.screenshot.is-narrow img { max-width: 100%; }
  .cta-card { padding: 28px 22px; margin: 36px 0; }
  .cta-card h3 { font-size: 19px; }
  .footer-inner { flex-direction: column; gap: 24px; text-align: center; }
  .footer-bottom { flex-direction: column; gap: 12px; text-align: center; }
}
