:root {
  --bg: #0d1117;
  --bg-elev: #161b22;
  --bg-card: #11161d;
  --border: #2a313c;
  --text: #e6edf3;
  --text-muted: #9aa6b2;
  --accent: #7c5cff;
  --accent-soft: rgba(124, 92, 255, 0.15);
  --code-bg: #0a0e14;
  --link: #8ab4ff;
  --max-w: 980px;
  --radius: 10px;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #ffffff;
    --bg-elev: #f6f8fa;
    --bg-card: #ffffff;
    --border: #d0d7de;
    --text: #1f2328;
    --text-muted: #57606a;
    --accent: #6b46ff;
    --accent-soft: rgba(124, 92, 255, 0.12);
    --code-bg: #f6f8fa;
    --link: #0969da;
  }
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue",
    "Hiragino Sans", "Noto Sans CJK JP", "Noto Sans SC", Arial, sans-serif;
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--link);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

code {
  font-family:
    ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono",
    monospace;
  font-size: 0.92em;
  background: var(--code-bg);
  padding: 0.1em 0.35em;
  border-radius: 4px;
  border: 1px solid var(--border);
}

pre {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  overflow-x: auto;
  font-size: 0.9em;
  line-height: 1.55;
}
pre code {
  background: transparent;
  padding: 0;
  border: none;
  border-radius: 0;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 12px 24px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--border);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
  font-size: 1.05rem;
}
.brand:hover {
  text-decoration: none;
}
.brand-mark {
  flex: 0 0 auto;
}

.nav {
  display: flex;
  gap: 18px;
  margin-left: auto;
  flex-wrap: wrap;
}
.nav a {
  color: var(--text-muted);
  font-size: 0.94rem;
}
.nav a:hover {
  color: var(--text);
  text-decoration: none;
}

.lang-switch {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px;
  background: var(--bg-elev);
  gap: 2px;
}
.lang-switch button {
  background: transparent;
  color: var(--text-muted);
  border: none;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.8rem;
  cursor: pointer;
  font: inherit;
  line-height: 1.2;
}
.lang-switch button[aria-selected="true"] {
  background: var(--accent);
  color: #fff;
}

main {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
}

.hero {
  padding: 80px 0 64px;
  text-align: left;
}
.eyebrow {
  margin: 0 0 14px;
  color: var(--accent);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
}
.hero h1 {
  font-size: clamp(2rem, 4.4vw, 3.2rem);
  line-height: 1.1;
  margin: 0 0 18px;
  letter-spacing: -0.02em;
}
.lede {
  font-size: 1.1rem;
  color: var(--text);
  max-width: 720px;
  margin: 0 0 26px;
}

.cta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}
.btn {
  display: inline-flex;
  align-items: center;
  padding: 9px 16px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--text);
  font-weight: 500;
  font-size: 0.95rem;
}
.btn:hover {
  text-decoration: none;
  border-color: var(--accent);
}
.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.btn-primary:hover {
  background: color-mix(in srgb, var(--accent) 85%, white);
}
.btn-ghost {
  background: transparent;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 6px 0 0;
}
.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #3fb950;
  box-shadow: 0 0 0 3px rgba(63, 185, 80, 0.18);
}

.section {
  padding: 48px 0;
  border-top: 1px solid var(--border);
}
.section h2 {
  font-size: 1.6rem;
  margin: 0 0 14px;
  letter-spacing: -0.01em;
}
.section h3.sub {
  font-size: 1.05rem;
  margin: 28px 0 8px;
  color: var(--text);
}
.section p {
  max-width: 720px;
}
.section-lede {
  color: var(--text-muted);
  margin: 0 0 22px;
  max-width: 720px;
}
.section-beyond {
  background: linear-gradient(
    180deg,
    var(--accent-soft) 0%,
    transparent 200px
  );
}
.recipe {
  margin: 8px 0 22px;
  padding-left: 1.4em;
  max-width: 720px;
}
.recipe li {
  margin: 6px 0;
}
.sketch {
  margin: 8px 0 18px;
  display: grid;
  gap: 14px;
}
.sketch dt {
  font-weight: 600;
  font-size: 1rem;
  color: var(--text);
  margin: 0 0 4px;
}
.sketch dd {
  margin: 0 0 0;
  padding: 12px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--text);
  max-width: 720px;
}
.note {
  color: var(--text-muted);
  font-style: italic;
  border-top: 1px dashed var(--border);
  padding-top: 16px;
  margin-top: 22px;
}
.section-try pre {
  max-width: 720px;
}
.section-try p {
  color: var(--text-muted);
}

/* Lifecycle */
.lifecycle {
  list-style: none;
  counter-reset: lc;
  padding: 0;
  margin: 8px 0 18px;
  display: grid;
  gap: 12px;
}
.lifecycle li {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 14px;
  align-items: start;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  max-width: 760px;
}
.lifecycle .step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
  font-size: 0.95rem;
}
.lifecycle strong {
  display: block;
  font-size: 1rem;
  margin-bottom: 2px;
  color: var(--text);
}
.lifecycle p {
  margin: 0;
  color: var(--text);
  max-width: none;
}

/* FAQ */
.faq {
  margin: 8px 0 0;
  display: grid;
  gap: 14px;
  max-width: 760px;
}
.faq dt {
  font-weight: 600;
  font-size: 1.02rem;
  color: var(--text);
  margin: 0;
  position: relative;
  padding-left: 22px;
}
.faq dt::before {
  content: "Q";
  position: absolute;
  left: 0;
  top: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: var(--accent);
  font-weight: 700;
}
.faq dd {
  margin: 4px 0 0 22px;
  padding: 0;
  color: var(--text-muted);
  position: relative;
  padding-left: 22px;
}
.faq dd::before {
  content: "A";
  position: absolute;
  left: 0;
  top: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: var(--text-muted);
  font-weight: 700;
}
.faq dd a {
  color: var(--link);
}

/* Limits */
.limits {
  list-style: none;
  padding: 0;
  margin: 8px 0 0;
  display: grid;
  gap: 10px;
  max-width: 760px;
}
.limits li {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  border-left: 3px solid #d0823e;
}
.limits strong {
  color: var(--text);
  font-weight: 600;
}
.limits span {
  color: var(--text-muted);
}

/* Quote attribution */
.quote-attr {
  display: block;
  margin-top: 8px;
  font-size: 0.9rem;
  color: var(--text-muted);
  font-style: italic;
}

/* Mobile tweaks */
@media (max-width: 640px) {
  .lifecycle li {
    grid-template-columns: 32px 1fr;
    gap: 10px;
    padding: 12px;
  }
  .lifecycle .step-num {
    width: 26px;
    height: 26px;
    font-size: 0.85rem;
  }
}

.quote {
  margin: 18px 0 0;
  padding: 14px 18px;
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  border-radius: 0 var(--radius) var(--radius) 0;
}
.quote p {
  margin: 0;
}

.tool-grid {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}
.tool-grid li {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  transition:
    border-color 0.15s ease,
    transform 0.15s ease;
}
.tool-grid li:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}
.tool-name {
  font-family:
    ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono",
    monospace;
  font-size: 0.92rem;
  color: var(--text);
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  margin: 18px 0 0;
}
.card h3 {
  margin: 0 0 10px;
  font-size: 1.1rem;
}
.card pre {
  margin: 10px 0;
}

.link-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.link-list li {
  padding: 8px 0;
  border-bottom: 1px dashed var(--border);
  color: var(--text-muted);
}
.link-list li:last-child {
  border-bottom: none;
}

.site-footer {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 40px 24px 56px;
  color: var(--text-muted);
  font-size: 0.9rem;
  border-top: 1px solid var(--border);
}
.site-footer p {
  margin: 4px 0;
}
.muted {
  color: var(--text-muted);
}

@media (max-width: 640px) {
  .site-header {
    flex-wrap: wrap;
    padding: 10px 16px;
  }
  .nav {
    order: 3;
    width: 100%;
    margin-left: 0;
    justify-content: flex-start;
  }
  main {
    padding: 0 16px;
  }
  .hero {
    padding: 56px 0 40px;
  }
  .section {
    padding: 40px 0;
  }
}
