/* ===== Reset ===== */
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; overscroll-behavior-y: none; }
body {
  font-family: system-ui, "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
  line-height: 1.75;
  font-size: 16px;
}
h1, h2, h3, h4, p, dl, dd { margin: 0; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
button:disabled { cursor: default; opacity: .5; }
button, a, input { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
ul { margin: 0; padding: 0; list-style: none; }
img, canvas { display: block; max-width: 100%; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ===== Tokens (dark / purple, 文字森系) ===== */
:root {
  --bg: #0b0a13;
  --bg-deep: #050509;
  --surface: #171525;
  --surface-soft: #1d1a2e;
  --surface-raised: #211d36;
  --border: #ada0f055;
  --border-soft: #ada0f026;
  --text: #ece9fb;
  --text-soft: #c3b9e6;
  --text-faint: #8d84ad;
  --accent: #b3aafa;
  --accent-soft: #c9bffc;
  --accent-deep: #7c6bf0;
  --gold: #d9c08a;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 10px;
  --max: 640px;
}

body {
  background: var(--bg);
  color: var(--text);
}

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 20px;
}

.kicker {
  display: inline-block;
  font: 650 11px/1.4 system-ui, sans-serif;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--accent-soft);
}

.eyebrow {
  font-size: 13px;
  letter-spacing: .04em;
  color: var(--text-faint);
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 26px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 650;
  border: 1px solid var(--border);
}
.btn-primary {
  background: linear-gradient(135deg, var(--accent-deep), var(--accent));
  color: #120f24;
  border-color: transparent;
  box-shadow: 0 10px 34px #6c56e84a;
}
.btn-ghost {
  background: var(--surface-soft);
  color: var(--text);
}
.btn-block { width: 100%; }
.btn-sm {
  min-height: 44px;
  padding: 10px 18px;
  font-size: 13px;
}

/* ===== Layout sections ===== */
section { padding: 64px 0; }
.section-tight { padding: 40px 0; }

/* ===== Hero ===== */
.hero {
  position: relative;
  isolation: isolate;
  min-height: 100svh;
  display: flex;
  align-items: center;
  overflow: hidden;
  padding: 0;
  background: radial-gradient(ellipse 120% 70% at 50% 28%, #251f44 0%, #140f24 52%, var(--bg-deep) 100%);
}
.hero canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; opacity: .85; }
.hero .wrap { position: relative; z-index: 2; width: 100%; text-align: center; padding: 120px 24px 80px; }
.hero .kicker { margin-bottom: 22px; }
.hero h1 {
  font-size: clamp(28px, 7vw, 44px);
  line-height: 1.5;
  font-weight: 700;
  letter-spacing: -.01em;
  margin-bottom: 20px;
  text-shadow: 0 2px 30px #0a081c;
}
.hero .subtitle {
  font-size: clamp(16px, 4vw, 19px);
  color: var(--text-soft);
  line-height: 1.8;
  margin-bottom: 28px;
}
.hero .lede {
  font-size: 15px;
  color: var(--text-faint);
  max-width: 420px;
  margin: 0 auto 36px;
  line-height: 1.9;
}
.hero .scroll-hint {
  margin-top: 28px;
  font-size: 11px;
  letter-spacing: .18em;
  color: var(--text-faint);
}

/* ===== Intro ===== */
.intro { background: var(--bg); }
.intro h2 {
  font-size: clamp(20px, 5vw, 26px);
  line-height: 1.6;
  margin-bottom: 24px;
}
.intro p { font-size: 16px; color: var(--text-soft); margin-bottom: 16px; }
.intro .stack { margin: 28px 0; }
.intro .stack p { margin-bottom: 6px; }
.callout {
  margin-top: 28px;
  padding: 22px 22px;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--border-soft);
}
.callout strong { color: var(--accent-soft); font-weight: 700; }

/* ===== How to use ===== */
.howto { background: var(--surface); }
.howto h2 { font-size: clamp(20px, 5vw, 24px); margin-bottom: 28px; text-align: center; }
.howto ol { display: grid; gap: 22px; }
.howto-item {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 16px;
  padding: 18px;
  background: var(--surface-soft);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
}
.howto-item .num {
  font-weight: 800;
  color: var(--accent-soft);
  font-size: 18px;
}
.howto-item h3 { font-size: 15px; margin-bottom: 6px; font-weight: 700; }
.howto-item p { font-size: 14px; color: var(--text-soft); }
.howto .note {
  margin-top: 24px;
  font-size: 13px;
  color: var(--text-faint);
  text-align: center;
  line-height: 1.8;
}
.ai-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 22px;
}

/* ===== Cards (STEP0 / STEP1-5) ===== */
.card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: 28px 20px;
}
.card + .card { margin-top: 18px; }
.step-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.step-no {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .14em;
  color: var(--gold);
}
.step-progress {
  font-size: 12px;
  color: var(--text-faint);
  letter-spacing: .04em;
}
.step h3 {
  font-size: clamp(19px, 5vw, 22px);
  line-height: 1.6;
  margin-bottom: 18px;
}
.step-meta {
  display: grid;
  gap: 10px;
  margin-bottom: 22px;
  padding: 16px;
  background: var(--surface-soft);
  border-radius: var(--radius-sm);
}
.step-meta dt { font-size: 11px; color: var(--text-faint); letter-spacing: .08em; margin-bottom: 2px; }
.step-meta dd { font-size: 14px; color: var(--text-soft); line-height: 1.7; }

.progress-bar {
  position: relative;
  height: 6px;
  border-radius: 99px;
  background: var(--surface-raised);
  overflow: hidden;
  margin-bottom: 4px;
}
.progress-bar > span {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-deep), var(--accent-soft));
  transition: width .4s ease;
}

/* ===== Variant toggle (ブラウザ版 / アプリ版) ===== */
.variant-toggle {
  display: flex;
  gap: 8px;
  margin: 20px 0 10px;
}
.variant-btn {
  flex: 1;
  min-height: 44px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 650;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-soft);
  color: var(--text-faint);
}
.variant-btn.is-active {
  background: linear-gradient(135deg, var(--accent-deep), var(--accent));
  color: #120f24;
  border-color: transparent;
}
.variant-hint {
  font-size: 12px;
  color: var(--text-faint);
  line-height: 1.8;
  margin-bottom: 4px;
}

/* ===== Prompt block ===== */
.prompt-block { margin: 22px 0; }
.prompt-label {
  font-size: 12px;
  color: var(--text-faint);
  margin-bottom: 8px;
  letter-spacing: .06em;
}
.prompt-text {
  position: relative;
  max-height: 150px;
  overflow: hidden;
  padding: 16px;
  background: var(--bg-deep);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  font-size: 13px;
  line-height: 1.85;
  color: var(--text-soft);
  white-space: pre-wrap;
  word-break: break-word;
}
.prompt-text::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 54px;
  background: linear-gradient(to bottom, transparent, var(--bg-deep));
  pointer-events: none;
}
.prompt-text.is-expanded { max-height: none; }
.prompt-text.is-expanded::after { display: none; }

.prompt-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.usage {
  margin: 18px 0;
  font-size: 14px;
  color: var(--text-soft);
  line-height: 1.85;
}
.usage strong { color: var(--text); }

.save-hint {
  margin: 18px 0;
  padding: 14px 16px;
  background: var(--surface-soft);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-soft);
}
.save-hint b { color: var(--accent-soft); }

.next-note {
  font-size: 12px;
  color: var(--text-faint);
  margin: 14px 0 0;
  line-height: 1.8;
}

.done-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 22px 0 16px;
  padding: 14px 16px;
  background: var(--surface-soft);
  border-radius: var(--radius-sm);
  min-height: 44px;
}
.done-row input[type="checkbox"] {
  width: 20px; height: 20px;
  accent-color: var(--accent-deep);
}
.done-row label { font-size: 14px; }

.next-link {
  margin-top: 6px;
}

/* ===== Headings copy (STEP0) ===== */
.headings-box {
  margin: 20px 0;
  padding: 16px;
  background: var(--bg-deep);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  font-size: 14px;
  line-height: 2;
  color: var(--text-soft);
  white-space: pre-wrap;
}

/* ===== Steps section wrapper ===== */
.steps-intro { text-align: center; margin-bottom: 28px; }
.steps-intro h2 { font-size: clamp(20px, 5vw, 24px); margin-bottom: 10px; }
.steps-intro p { font-size: 14px; color: var(--text-faint); }
#steps-container { display: grid; gap: 18px; }

/* ===== Notice ===== */
.notice {
  margin: 0 auto;
  padding: 18px 20px;
  background: var(--surface-soft);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  font-size: 13px;
  color: var(--text-faint);
  line-height: 1.9;
}
.notice h3 { font-size: 13px; color: var(--text-soft); margin-bottom: 8px; font-weight: 700; }

/* ===== Complete ===== */
.complete { text-align: center; background: radial-gradient(ellipse 100% 80% at 50% 20%, #221c3c 0%, var(--bg) 60%); }
.complete .sigil {
  margin: 0 auto 18px;
  width: 54px; height: 54px;
  display: grid; place-items: center;
  border-radius: 18px;
  background: #bda9fa22;
  border: 1px solid #bda9fa66;
  color: var(--accent-soft);
  font-size: 26px;
}
.complete h2 { font-size: clamp(22px, 6vw, 28px); margin-bottom: 10px; }
.complete .sub { color: var(--text-faint); font-size: 14px; margin-bottom: 26px; }
.complete p { font-size: 15px; color: var(--text-soft); margin-bottom: 14px; }

/* ===== Consulting CTA ===== */
.consulting {
  background: var(--surface);
  border-radius: var(--radius-lg);
  margin: 0 20px;
  padding: 40px 24px;
  text-align: center;
}
.consulting h2 { font-size: clamp(19px, 5vw, 23px); line-height: 1.6; margin-bottom: 18px; }
.consulting p { font-size: 14px; color: var(--text-soft); margin-bottom: 14px; line-height: 1.9; }
.consulting .quote {
  margin: 22px 0;
  display: grid; gap: 6px;
  font-size: 14px;
  color: var(--text-faint);
}
.consulting .btn { margin-top: 10px; }

/* ===== Footer ===== */
footer {
  padding: 48px 20px 40px;
  text-align: center;
  color: var(--text-faint);
  font-size: 12px;
  line-height: 1.9;
}
footer .brand { font-weight: 800; letter-spacing: .1em; color: var(--text-soft); margin-bottom: 8px; }
footer .foot-links { display: flex; justify-content: center; gap: 16px; margin: 14px 0; }
footer .foot-links a { color: var(--text-soft); }
footer .reset-link { margin-top: 18px; }
footer .reset-link button { font-size: 12px; color: var(--text-faint); text-decoration: underline; min-height: auto; padding: 4px; }

/* ===== Accessibility / status ===== */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip-path: inset(50%);
}
.announce {
  position: fixed;
  z-index: 100;
  bottom: 20px; left: 50%;
  transform: translate(-50%, 12px);
  padding: 12px 18px;
  border-radius: 30px;
  background: #231f3a;
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 13px;
  opacity: 0;
  transition: .25s;
  pointer-events: none;
  max-width: 90vw;
}
.announce.show { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

@media (max-width: 380px) {
  .wrap { padding: 0 16px; }
  .hero .wrap { padding: 100px 18px 64px; }
  .card { padding: 22px 16px; }
}
