:root {
  --fg: #1a1a1a;
  --fg-sub: #444;
  --fg-muted: #888;
  --bg: #ffffff;
  --bg-alt: #f4f7fb;
  --accent: #1a7a6d;
  --border: #ddd;
  --code-bg: #1c1c1e;
  --code-fg: #d4d4d4;
  --code-comment: #6a6a6a;
  --font-body: 'Noto Sans JP', sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;
  --max-w: 720px;
}

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

body {
  font-family: var(--font-body);
  font-size: 16.5px;
  line-height: 1.85;
  color: var(--fg);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

.container { max-width: var(--max-w); margin: 0 auto; padding: 0 1.5rem; }

/* Sticky Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0.6rem 0;
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.site-header .logo {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 500;
  color: var(--fg);
  text-decoration: none;
  letter-spacing: 0.04em;
}
.site-header .header-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.site-header .lang-switch {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--fg-muted);
  text-decoration: none;
  transition: color 0.2s;
}
.site-header .lang-switch:hover { color: var(--accent); }
.site-header .github-link {
  display: flex;
  align-items: center;
  color: var(--fg);
  text-decoration: none;
  transition: color 0.2s;
}
.site-header .github-link:hover { color: var(--accent); }
.site-header .github-link svg { width: 24px; height: 24px; }

/* Hero */
.hero {
  padding: 6rem 0 5rem;
}
.hero p.label {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 0.8rem;
}
.hero h1 {
  font-weight: 700;
  font-size: clamp(1.8rem, 4.5vw, 2.6rem);
  line-height: 1.35;
  margin-bottom: 1.5rem;
}
.hero .lead {
  font-size: 1.1rem;
  font-weight: 400;
  color: var(--fg-sub);
}

/* Hero CTA */
.hero-cta {
  display: flex;
  gap: 0.8rem;
  margin-top: 2rem;
  flex-wrap: wrap;
  align-items: center;
}
.btn-secondary {
  display: inline-block;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--accent);
  background: transparent;
  padding: 0.7em 1.6em;
  border-radius: 4px;
  border: 2px solid var(--accent);
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
}
.btn-secondary:hover { background: var(--accent); color: #fff; }

/* Hero Brew Snippet */
.hero-brew {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1.5rem;
  background: var(--code-bg);
  border-radius: 4px;
  padding: 0.5rem 0.8rem;
  max-width: fit-content;
}
.hero-brew code {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--code-fg);
  background: none;
  padding: 0;
  white-space: nowrap;
}

/* Section CTA */
.section-cta {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.section-cta p {
  font-size: 0.92rem;
  color: var(--fg-muted);
  margin: 0;
}
.section-cta .btn { font-size: 0.85rem; padding: 0.5em 1.2em; }
.section-cta .btn-secondary { font-size: 0.85rem; padding: 0.5em 1.2em; }

/* Badges */
.hero-badges {
  display: flex;
  gap: 0.5rem;
  margin-top: 1.2rem;
}
.badge {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  padding: 0.2em 0.6em;
  border-radius: 3px;
  letter-spacing: 0.03em;
}
.badge-alpha {
  background: #fef3c7;
  color: #92400e;
}
.badge-license {
  background: #e0f2fe;
  color: #0c4a6e;
}

/* Copy Button */
.copy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid #555;
  border-radius: 3px;
  color: var(--code-fg);
  cursor: pointer;
  padding: 0.25rem 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  transition: border-color 0.2s, color 0.2s;
  flex-shrink: 0;
  white-space: nowrap;
}
.copy-btn:hover { border-color: var(--accent); color: var(--accent); }
.copy-btn.copied { border-color: var(--accent); color: var(--accent); }

/* Code block with copy */
.code-with-copy {
  position: relative;
}
.code-with-copy .copy-btn {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
}

/* Sections */
section { padding: 4rem 0; }

h2 {
  font-weight: 700;
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
}

h3 {
  font-weight: 600;
  font-size: 1.1rem;
  margin: 2.5rem 0 0.5rem;
}

h3:first-child { margin-top: 0; }

p { color: var(--fg-sub); margin-bottom: 0.8rem; font-weight: 400; }
p:last-child { margin-bottom: 0; }

/* Lists */
ul {
  list-style: none;
  padding: 0;
  margin-bottom: 1rem;
}
li {
  padding: 0.3rem 0 0.3rem 1.2rem;
  position: relative;
  color: var(--fg-sub);
  font-size: 0.97rem;
}
li::before {
  content: '\00b7';
  position: absolute;
  left: 0;
  font-weight: 700;
  color: var(--fg-muted);
}
li strong { color: var(--fg); font-weight: 600; }

/* Code blocks */
pre {
  background: var(--code-bg);
  color: var(--code-fg);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.7;
  padding: 1.2rem 1.4rem;
  border-radius: 4px;
  overflow-x: auto;
  margin: 0.8rem 0 1rem;
}
pre .c { color: var(--code-comment); }

/* Inline code */
code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--bg-alt);
  padding: 0.15em 0.35em;
  border-radius: 3px;
}
pre code {
  background: none;
  padding: 0;
  font-size: inherit;
  border-radius: 0;
}

/* Challenges section */
.challenges { background: var(--bg-alt); }

/* Tables */
.table-wrap { overflow-x: auto; margin: 0.8rem 0 1.5rem; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  line-height: 1.6;
}
thead th {
  text-align: left;
  font-weight: 600;
  font-size: 0.78rem;
  color: var(--fg-muted);
  padding: 0.5rem 0.8rem;
  border-bottom: 2px solid var(--fg);
  white-space: nowrap;
}
tbody td {
  padding: 0.6rem 0.8rem;
  border-bottom: 1px solid var(--border);
  color: var(--fg-sub);
  vertical-align: top;
}
tbody td:first-child { font-weight: 600; color: var(--fg); white-space: nowrap; }

/* FAQ */
.faq-item {
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--border);
}
.faq-item:first-child { padding-top: 0; }
.faq-item:last-child { border-bottom: none; }
.faq-item dt {
  font-weight: 600;
  font-size: 1rem;
  color: var(--fg);
  margin-bottom: 0.4rem;
}
.faq-item dd {
  margin: 0;
  color: var(--fg-sub);
  font-size: 0.95rem;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 3rem 0 2rem;
}
.footer-content {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.footer-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 2rem;
}
.footer-brand p {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--fg);
  margin-bottom: 0.3rem;
}
.footer-brand .sub {
  font-weight: 400;
  font-size: 0.9rem;
  color: var(--fg-muted);
}
.footer-links {
  display: flex;
  gap: 2.5rem;
}
.footer-links-group h4 {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.5rem;
}
.footer-links-group ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.footer-links-group li {
  padding: 0.15rem 0;
  font-size: 0.88rem;
}
.footer-links-group li::before { content: none; }
.footer-links-group a {
  color: var(--fg-sub);
  text-decoration: none;
  transition: color 0.2s;
}
.footer-links-group a:hover { color: var(--accent); }
.footer-links-group .github-footer-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}
.footer-links-group .github-footer-link svg { width: 16px; height: 16px; }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.82rem;
  color: var(--fg-muted);
}

/* Button */
.btn {
  display: inline-block;
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  padding: 0.7em 1.6em;
  border-radius: 4px;
  text-decoration: none;
  transition: background 0.2s;
}
.btn:hover { background: #156b60; }

/* Responsive */
@media (max-width: 600px) {
  .hero { padding: 4rem 0 3rem; }
  section { padding: 3rem 0; }
  table { font-size: 0.78rem; }
  thead th, tbody td { padding: 0.4rem 0.5rem; }
  .hero-cta { flex-direction: column; align-items: flex-start; }
  .footer-top { flex-direction: column; }
  .footer-links { flex-direction: column; gap: 1.5rem; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
}
