:root {
  --bg: #0b0d12;
  --bg-soft: #12151d;
  --card: #171b26;
  --line: #262c3b;
  --text: #e8ecf4;
  --muted: #9aa4b8;
  --accent: #5b8cff;
  --accent-2: #8f6bff;
  --good: #37d99a;
  --warn: #ffb454;
  --radius: 14px;
  --font: "Inter", "Segoe UI", "Hiragino Sans", "Yu Gothic UI", sans-serif;
  --mono: "Cascadia Code", "JetBrains Mono", Consolas, monospace;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
}
/* Language toggle: body.lang-en hides .jp, body.lang-jp hides .en */
body.lang-en .jp { display: none; }
body.lang-jp .en { display: none; }

.container { max-width: 1080px; margin: 0 auto; padding: 0 24px; }

/* ---------- Header ---------- */
header {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(14px);
  background: rgba(11,13,18,.8);
  border-bottom: 1px solid var(--line);
}
.nav {
  display: flex; align-items: center; gap: 28px;
  height: 64px;
}
.logo {
  font-weight: 800; font-size: 1.15rem; letter-spacing: .02em;
  text-decoration: none; color: var(--text);
  display: flex; align-items: center; gap: 10px;
}
.logo .mark {
  width: 28px; height: 28px; border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: inline-flex; align-items: center; justify-content: center;
  font-size: .85rem; font-weight: 900; color: #fff;
}
.nav-links { display: flex; gap: 22px; margin-left: auto; }
.nav-links a {
  color: var(--muted); text-decoration: none; font-size: .92rem; font-weight: 500;
  transition: color .15s;
}
.nav-links a:hover { color: var(--text); }
.lang-toggle {
  display: flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden;
  flex-shrink: 0;
}
@media (max-width: 820px) {
  .nav { gap: 14px; }
  .nav-links { display: none; }
  .nav .btn { padding: 8px 14px; font-size: .85rem; margin-left: auto; }
  .nav .lang-toggle { margin-left: auto; }
  .nav-links + .lang-toggle { margin-left: auto; }
}
.lang-toggle button {
  background: none; border: 0; color: var(--muted); font: inherit;
  font-size: .8rem; padding: 4px 12px; cursor: pointer;
}
.lang-toggle button.active { background: var(--accent); color: #fff; }
.btn {
  display: inline-block; text-decoration: none; font-weight: 600;
  padding: 10px 22px; border-radius: 999px; font-size: .95rem;
  transition: transform .15s, box-shadow .15s;
}
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; box-shadow: 0 4px 24px rgba(91,140,255,.35);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 32px rgba(91,140,255,.5); }
.btn-ghost { border: 1px solid var(--line); color: var(--text); }
.btn-ghost:hover { border-color: var(--accent); }

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden;
  padding: 110px 0 90px; text-align: center;
}
.hero::before {
  content: ""; position: absolute; inset: -40% -20% auto;
  height: 130%;
  background:
    radial-gradient(600px 300px at 30% 20%, rgba(91,140,255,.18), transparent 70%),
    radial-gradient(600px 300px at 70% 10%, rgba(143,107,255,.15), transparent 70%);
  pointer-events: none;
}
.hero .badge {
  display: inline-block; font-size: .8rem; font-weight: 600;
  color: var(--warn); border: 1px solid rgba(255,180,84,.4);
  background: rgba(255,180,84,.08);
  padding: 4px 14px; border-radius: 999px; margin-bottom: 26px;
}
.hero h1 {
  font-size: clamp(2rem, 5vw, 3.3rem); font-weight: 800; line-height: 1.25;
  letter-spacing: -.02em; margin-bottom: 18px;
}
.hero h1 .grad {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero .sub {
  font-size: 1.35rem; font-weight: 700; letter-spacing: .12em;
  color: var(--muted); margin-bottom: 26px;
}
.hero p.lead { max-width: 620px; margin: 0 auto 36px; color: var(--muted); font-size: 1.05rem; }
.hero .cta-row { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.price { margin-top: 22px; font-size: .95rem; color: var(--muted); }
.price .now { color: var(--good); font-weight: 700; font-size: 1.1rem; }
.price .was { text-decoration: line-through; opacity: .6; margin-left: 6px; }

/* ---------- Sections ---------- */
section { padding: 80px 0; }
section.alt { background: var(--bg-soft); border-block: 1px solid var(--line); }
.kicker {
  font-size: .8rem; font-weight: 700; letter-spacing: .18em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 10px;
}
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); font-weight: 800; margin-bottom: 14px; letter-spacing: -.01em; }
.section-lead { color: var(--muted); max-width: 640px; margin-bottom: 42px; }

/* Before / After */
.flow-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
@media (max-width: 760px) { .flow-grid { grid-template-columns: 1fr; } }
.flow-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 28px;
}
.flow-card.after { border-color: rgba(91,140,255,.5); box-shadow: 0 0 40px rgba(91,140,255,.08) inset; }
.flow-card h3 { font-size: 1.05rem; margin-bottom: 16px; }
.flow-card.before h3 { color: var(--warn); }
.flow-card.after h3 { color: var(--accent); }
.flow-card ol { list-style: none; counter-reset: step; }
.flow-card ol li {
  counter-increment: step; position: relative;
  padding: 8px 0 8px 40px; color: var(--muted); font-size: .95rem;
}
.flow-card ol li::before {
  content: counter(step); position: absolute; left: 0; top: 8px;
  width: 26px; height: 26px; border-radius: 50%; font-size: .8rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  background: var(--line); color: var(--text);
}
.flow-card.after ol li::before { background: rgba(91,140,255,.25); color: var(--accent); }
.flow-card code { font-family: var(--mono); color: var(--good); font-size: .88em; }

/* Feature cards */
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
@media (max-width: 860px) { .features { grid-template-columns: 1fr; } }
.feature {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 30px; transition: transform .2s, border-color .2s;
}
.feature:hover { transform: translateY(-4px); border-color: var(--accent); }
.feature .icon {
  width: 46px; height: 46px; border-radius: 12px; font-size: 1.3rem;
  display: flex; align-items: center; justify-content: center; margin-bottom: 18px;
  background: linear-gradient(135deg, rgba(91,140,255,.2), rgba(143,107,255,.2));
}
.feature h3 { font-size: 1.15rem; margin-bottom: 10px; }
.feature p { color: var(--muted); font-size: .95rem; }

/* Comparison table */
.compare { width: 100%; border-collapse: collapse; background: var(--card); border-radius: var(--radius); overflow: hidden; }
.compare th, .compare td { padding: 16px 20px; text-align: left; border-bottom: 1px solid var(--line); font-size: .95rem; }
.compare th { background: var(--bg-soft); font-size: .85rem; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.compare td:first-child { font-weight: 700; white-space: nowrap; }
.compare tr.hero-row td { background: rgba(91,140,255,.08); }
.compare tr.hero-row td:first-child { color: var(--accent); }
.compare td.desc { color: var(--muted); }

/* Value props */
.values { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; text-align: center; }
@media (max-width: 860px) { .values { grid-template-columns: 1fr; } }
.value .big {
  font-size: 1.5rem; font-weight: 800;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  margin-bottom: 8px;
}
.value p { color: var(--muted); font-size: .92rem; }

/* Code block */
.codeblock {
  background: #0d1017; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px 30px; font-family: var(--mono); font-size: .92rem; line-height: 2;
  overflow-x: auto;
}
.codeblock .cm { color: #5c6675; }
.codeblock .cls { color: #7dcfff; }
.codeblock .fn { color: #bb9af7; }
.codeblock .str { color: #9ece6a; }
.codeblock .kw { color: #f7768e; }

/* CTA band */
.cta-band { text-align: center; padding: 90px 0; }
.cta-band h2 { margin-bottom: 24px; }

/* Footer */
footer { border-top: 1px solid var(--line); padding: 50px 0 40px; color: var(--muted); font-size: .9rem; }
.footer-grid { display: flex; flex-wrap: wrap; gap: 40px; justify-content: space-between; margin-bottom: 30px; }
.footer-grid h4 { color: var(--text); font-size: .85rem; letter-spacing: .1em; text-transform: uppercase; margin-bottom: 12px; }
.footer-grid a { display: block; color: var(--muted); text-decoration: none; padding: 3px 0; }
.footer-grid a:hover { color: var(--text); }
.footer-bottom { border-top: 1px solid var(--line); padding-top: 22px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; }

/* ---------- Tutorial page ---------- */
.doc-layout { display: grid; grid-template-columns: 250px 1fr; gap: 48px; padding: 48px 0 90px; }
@media (max-width: 860px) { .doc-layout { grid-template-columns: 1fr; } }
.doc-nav { position: sticky; top: 90px; align-self: start; }
.doc-nav h4 { font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 22px 0 8px; }
.doc-nav a {
  display: block; color: var(--muted); text-decoration: none; font-size: .92rem;
  padding: 6px 12px; border-left: 2px solid var(--line); transition: color .15s, border-color .15s;
}
.doc-nav a:hover { color: var(--text); border-color: var(--accent); }
.doc-body h1 { font-size: 2.2rem; font-weight: 800; margin-bottom: 12px; }
.doc-body .doc-lead { color: var(--muted); margin-bottom: 40px; }
.doc-section { margin-bottom: 56px; scroll-margin-top: 90px; }
.doc-section h2 { border-bottom: 1px solid var(--line); padding-bottom: 10px; margin-bottom: 18px; }
.doc-section p { color: var(--muted); margin-bottom: 14px; }
.doc-section ul { color: var(--muted); padding-left: 22px; margin-bottom: 14px; }
.mode-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 760px) { .mode-grid { grid-template-columns: 1fr; } }
.mode-card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 18px; }
.mode-card h3 { font-size: 1rem; margin-bottom: 6px; color: var(--accent); }
.mode-card p { font-size: .88rem; margin: 0; }
/* PDF documents */
.pdf-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 8px; }
@media (max-width: 860px) { .pdf-grid { grid-template-columns: 1fr; } }
.pdf-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 20px; display: flex; flex-direction: column;
  transition: transform .15s, border-color .15s;
}
.pdf-card:hover { transform: translateY(-3px); border-color: var(--accent); }
.pdf-card .pdf-thumb {
  width: 52px; height: 64px; border-radius: 6px; font-size: 1.6rem;
  display: flex; align-items: center; justify-content: center; margin-bottom: 14px;
  background: linear-gradient(160deg, rgba(91,140,255,.25), rgba(143,107,255,.25));
  border: 1px solid var(--line);
}
.pdf-card h3 { font-size: 1.02rem; margin-bottom: 8px; }
.pdf-card p { font-size: .86rem; flex: 1; }
.pdf-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.pdf-actions .btn { padding: 7px 14px; font-size: .82rem; }
.btn-sm { padding: 5px 12px !important; font-size: .78rem !important; }

.pdf-viewer {
  margin-top: 22px; border: 1px solid var(--accent); border-radius: var(--radius);
  overflow: hidden; background: var(--card);
  box-shadow: 0 8px 40px rgba(91,140,255,.15);
}
.pdf-viewer-bar {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px; background: var(--bg-soft); border-bottom: 1px solid var(--line);
  font-weight: 600; font-size: .9rem;
}
.pdf-viewer iframe { display: block; width: 100%; height: 560px; border: 0; background: #3a3f4c; }

.faq details { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 14px 18px; margin-bottom: 10px; }
.faq summary { cursor: pointer; font-weight: 600; }
.faq p { margin-top: 10px; }

/* ---------- Focus visibility ---------- */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
.cat-card:focus-visible,
.btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
