:root {
  color-scheme: light dark;
  --bg: #ffffff;
  --fg: #1f2937;
  --muted: #6b7280;
  --link: #0f6cbf;
  --border: #e5e7eb;
  --code-bg: #f6f8fa;
  --quote-bg: #f8fafc;
  --syntax-default: #0b3da6;
  --syntax-keyword: #1a7f37;
  --syntax-string: #c62828;
  --syntax-comment: #bb5200;
  --syntax-punctuation: #24292f;
  --syntax-number: #0a7a7a;
  --syntax-generic: #6b7280;
  --syntax-delete-bg: #ffdddd;
  --syntax-insert-bg: #ddffdd;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f172a;
    --fg: #e5e7eb;
    --muted: #9ca3af;
    --link: #7cc4ff;
    --border: #334155;
    --code-bg: #111827;
    --quote-bg: #111827;
    --syntax-default: #93c5fd;
    --syntax-keyword: #86efac;
    --syntax-string: #fca5a5;
    --syntax-comment: #fdba74;
    --syntax-punctuation: #e5e7eb;
    --syntax-number: #67e8f9;
    --syntax-generic: #9ca3af;
    --syntax-delete-bg: #4c1d1d;
    --syntax-insert-bg: #14532d;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  line-height: 1.75;
}

.page {
  width: min(100% - 32px, 980px);
  margin: 0 auto;
  padding: 40px 0 72px;
}

.page-home {
  width: min(100% - 32px, 1180px);
}

h1, h2, h3 {
  line-height: 1.25;
  margin-top: 2em;
  margin-bottom: 0.75em;
}

h1 { font-size: clamp(2rem, 5vw, 3rem); margin-top: 0; }
h2 { border-bottom: 1px solid var(--border); padding-bottom: 0.25em; }

a { color: var(--link); text-underline-offset: 0.18em; }

p, ul, ol, table, pre, blockquote { margin: 1em 0; }

pre, code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  background: var(--code-bg);
  border-radius: 6px;
}

code { padding: 0.15em 0.35em; }

pre {
  overflow-x: auto;
  padding: 1rem;
  border: 1px solid var(--border);
}

pre code { padding: 0; background: transparent; }

.highlight {
  color: var(--syntax-default);
  background: var(--code-bg);
  border-radius: 6px;
}

.highlight pre {
  margin: 0;
}

.highlight,
.highlight pre,
.highlight code {
  font-variant-ligatures: none;
}

.highlight .c,
.highlight .c1,
.highlight .cm,
.highlight .cs,
.highlight .cp {
  color: var(--syntax-comment);
  font-style: normal;
}

.highlight .s,
.highlight .s1,
.highlight .s2,
.highlight .sb,
.highlight .sc,
.highlight .sd,
.highlight .se,
.highlight .sh,
.highlight .si,
.highlight .sx,
.highlight .sr {
  color: var(--syntax-string);
}

.highlight .k,
.highlight .kc,
.highlight .kd,
.highlight .kn,
.highlight .kp,
.highlight .kr,
.highlight .kt {
  color: var(--syntax-keyword);
  font-weight: normal;
}

.highlight .m,
.highlight .mi,
.highlight .mf,
.highlight .mh,
.highlight .mo,
.highlight .il {
  color: var(--syntax-number);
}

.highlight .n,
.highlight .na,
.highlight .nb,
.highlight .bp,
.highlight .nc,
.highlight .no,
.highlight .nv,
.highlight .vc,
.highlight .vg,
.highlight .vi,
.highlight .nn,
.highlight .nx,
.highlight .nt,
.highlight .o,
.highlight .w {
  color: var(--syntax-default);
}

.highlight .p {
  color: var(--syntax-punctuation);
}

.highlight .gd {
  color: var(--fg);
  background: var(--syntax-delete-bg);
}

.highlight .gi {
  color: var(--fg);
  background: var(--syntax-insert-bg);
}

.highlight .gr,
.highlight .gt {
  color: var(--syntax-string);
}

.highlight .gh,
.highlight .gu,
.highlight .go,
.highlight .gp {
  color: var(--syntax-generic);
}

.highlight .gs {
  font-weight: bold;
}

.highlight .ge {
  font-style: italic;
}

blockquote {
  margin-left: 0;
  padding: 0.8rem 1rem;
  color: var(--muted);
  background: var(--quote-bg);
  border-left: 4px solid var(--border);
}

table {
  width: 100%;
  border-collapse: collapse;
  display: block;
  overflow-x: auto;
}

th, td {
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border);
  vertical-align: top;
}

th { background: var(--code-bg); }

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

html[data-doc-lang="en"] [data-lang="ja"],
html[data-doc-lang="ja"] [data-lang="en"] {
  display: none !important;
}

.language-switcher {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.language-label {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.language-options {
  display: inline-flex;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--quote-bg);
}

.language-option {
  min-width: 5rem;
  padding: 0.45rem 0.75rem;
  border: 0;
  border-left: 1px solid var(--border);
  background: transparent;
  color: var(--fg);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.language-option:first-child {
  border-left: 0;
}

.language-option[aria-pressed="true"] {
  background: var(--fg);
  color: var(--bg);
}

.language-option:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: -2px;
}

.hero {
  display: flex;
  align-items: center;
  gap: clamp(1.5rem, 4vw, 3rem);
  margin-bottom: 2rem;
  padding: 2rem 0 1rem;
}

.brand-logo {
  display: block;
  flex: 0 0 auto;
  width: min(220px, 34vw);
  height: auto;
  aspect-ratio: 1;
  margin: 0;
  object-fit: contain;
}

.hero-copy {
  min-width: 0;
}

.product-label {
  margin: 0 0 0.45rem;
  color: var(--muted);
  font-size: 1.08rem;
  font-weight: 700;
  line-height: 1.3;
}

.hero h1 {
  margin: 0 0 0.45em;
  font-size: clamp(2.5rem, 4.4vw, 4rem);
  line-height: 1.08;
}

.lead {
  max-width: 760px;
  color: var(--muted);
  font-size: 1.15rem;
}

@media (max-width: 760px) {
  .hero {
    display: block;
  }

  .brand-logo {
    width: min(180px, 52vw);
    margin-bottom: 1.25rem;
  }

  .hero h1 {
    font-size: clamp(2.05rem, 8vw, 2.6rem);
  }
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 1rem;
  margin: 2rem 0;
}

.card {
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--quote-bg);
}

.card h2 {
  margin-top: 0;
  border-bottom: 0;
  padding-bottom: 0;
}

.en {
  color: var(--muted);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
}

.button {
  display: inline-block;
  padding: 0.55rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg);
  font-weight: 700;
  text-decoration: none;
}

.button:hover {
  border-color: currentColor;
}
