:root {
  --bg: #000;
  --fg: #fff;
  --muted: #b3b3b3;
  --line: #1f1f1f;
  --card-line: #2a2a2a;
  --code-bg: #1e1e1e;
  --mono: "JetBrains Mono", SFMono-Regular, Menlo, Consolas, "Cascadia Mono", "DejaVu Sans Mono", "Liberation Mono", monospace;
  --sans: Inter, "Noto Sans JP", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--fg); font-family: var(--sans); line-height: 1.6; -webkit-font-smoothing: antialiased; }
a { color: var(--fg); }
a:hover { color: #cfcfcf; }
:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }

/* language switching: both languages sit in the same grid cell, so the
   layout keeps the size of the longer one and nothing moves on switch */
:has(> [lang="en"] + [lang="ja"]) { display: grid; }
a:has(> [lang="en"] + [lang="ja"]), .title:has(> [lang="en"] + [lang="ja"]) { display: inline-grid; }
.btn:has(> [lang="en"] + [lang="ja"]) { display: inline-grid; place-items: center; }
.links > a:has(> [lang="en"] + [lang="ja"]) { justify-items: center; }
:has(> [lang="en"] + [lang="ja"]) > [lang] { grid-area: 1 / 1; }
html[data-lang="en"] [lang="ja"]:not(html),
html[data-lang="ja"] [lang="en"]:not(html) { visibility: hidden; }

.wrap { max-width: 1200px; margin: 0 auto; padding: 0 32px; }
section { border-top: 1px solid var(--line); }
.section { padding-top: 96px; padding-bottom: 96px; }
.eyebrow { margin: 0; font-family: var(--mono); font-size: 14px; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; }
h1, h2, h3 { margin: 0; }
h2 { font-size: 44px; font-weight: 800; letter-spacing: -.03em; line-height: 1.15; }
h3 { font-size: 21px; font-weight: 600; }
p { margin: 0; }
.muted { color: var(--muted); }

/* header */
header { border-bottom: 1px solid var(--line); }
nav.top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 0; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; font-weight: 800; font-size: 20px; letter-spacing: -.02em; }
.links { display: flex; flex-wrap: wrap; align-items: center; gap: 24px; font-size: 15px; }
.links > a { text-decoration: none; color: var(--muted); }
.links > a:hover { color: var(--fg); }
.lang-switch { display: flex; gap: 2px; padding: 3px; border: 1px solid #3a3a3a; border-radius: 999px; }
.lang-switch button { border: 0; border-radius: 999px; padding: 8px 14px; min-height: 36px; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; background: transparent; color: var(--muted); }
.lang-switch button[aria-pressed="true"] { background: #fff; color: #000; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 26px; border-radius: 999px; font-weight: 600; font-size: 16px; text-decoration: none; }
.btn.primary { background: #fff; color: #000; }
.btn.primary:hover { background: #e6e6e6; color: #000; }
.btn.ghost { border: 1px solid #3a3a3a; }
.btn.small { min-height: 40px; padding: 0 18px; font-size: 15px; }

/* hero */
.hero { display: flex; flex-wrap: wrap; align-items: center; gap: 64px; padding: 112px 0 96px; }
.hero-text { flex: 1 1 520px; min-width: 0; display: flex; flex-direction: column; gap: 26px; align-items: flex-start; }
.hero h1 { font-size: clamp(40px, 5.6vw, 72px); line-height: 1.08; font-weight: 800; letter-spacing: -.03em; }
.hero h1 > [lang="ja"] { font-size: clamp(34px, 4.4vw, 60px); line-height: 1.2; }
.lead { font-size: 20px; line-height: 1.7; color: var(--muted); max-width: 560px; }
.badge { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border: 1px solid #3a3a3a; border-radius: 999px; font-family: var(--mono); font-size: 13px; color: var(--muted); }
.badge::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #f5c542; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* code */
.code { flex: 1 1 520px; min-width: 0; background: var(--code-bg); border: 1px solid var(--card-line); border-radius: 16px; overflow: hidden; }
.code-head { display: flex; align-items: center; gap: 10px; padding: 14px 20px; border-bottom: 1px solid var(--card-line); font-family: var(--mono); font-size: 13px; color: var(--muted); }
pre { margin: 0; padding: 24px; font-family: var(--mono); font-size: 14.5px; line-height: 1.75; overflow-x: auto; color: #d4d4d4; }
pre code { font-family: inherit; font-size: inherit; }
.k { color: #c586c0; } .t { color: #4ec9b0; } .f { color: #dcdcaa; } .s { color: #ce9178; } .n { color: #b5cea8; } .c { color: #8b949e; } .d { color: #569cd6; }

/* cards */
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.card { border: 1px solid var(--card-line); border-radius: 16px; padding: 30px; display: flex; flex-direction: column; gap: 12px; }
.card p { color: var(--muted); font-size: 16px; line-height: 1.7; }
.card code, .inline { font-family: var(--mono); font-size: .92em; background: #161616; padding: 1px 6px; border-radius: 6px; color: #e6e6e6; }
.stack { display: flex; flex-direction: column; gap: 48px; }

/* ai */
.split { display: flex; flex-wrap: wrap; gap: 64px; }
.split > div { flex: 1 1 400px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.row-card { flex-direction: row; gap: 20px; align-items: flex-start; }
.row-card svg { flex: none; }

/* start */
.term { background: #0f0f0f; border: 1px solid var(--card-line); border-radius: 16px; }
.term pre { font-size: 14px; }
.reqs { margin: 0; padding-left: 20px; color: var(--muted); display: flex; flex-direction: column; gap: 6px; }

/* docs */
a.card { text-decoration: none; transition: border-color .15s; }
a.card:hover { border-color: #5a5a5a; color: var(--fg); }
a.card .title { font-size: 20px; font-weight: 600; }

footer { border-top: 1px solid var(--line); }
.foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding-top: 40px; padding-bottom: 40px; font-size: 14px; color: var(--muted); }
.foot a { color: var(--muted); }
.foot .left { display: flex; align-items: center; gap: 10px; }
.foot .right { display: flex; gap: 24px; }

@media (max-width: 640px) {
  .wrap { padding: 0 20px; }
  .section { padding-top: 72px; padding-bottom: 72px; }
  .hero { padding: 72px 0; gap: 40px; }
  h2 { font-size: 34px; }
  .links { gap: 16px; }
}
