/* ============================================================
   AstriaWorks — 投資家タイプ診断  Design System v2
   基準: DESIGN.md（Stripe系「indigo-ink ledger on frosted glass」）
   ライトテーマ / 単色 + 単一インディゴアクセント / シャドウレス /
   4px角丸 / ヘアラインと余白で階層を作る「金融台帳」トーン。
   日本語本文の可読性に合わせ、ウェイトと行間のみAstriaWorks向けに調整。
   ============================================================ */

:root {
  /* ---------- Surfaces ---------- */
  --canvas: #ffffff;
  --band: #f8fafd;
  --frost: #e5edf5;
  --frost-strong: #d3dfec;
  --periwinkle-wash: #eef0ff;

  /* ---------- Text ---------- */
  --ink: #0b1f38;
  --slate: #5b6b85;
  --steel: #46536b;
  --smoke: #97a4c2;

  /* ---------- Accent (indigo — the single functional color) ---------- */
  --indigo: #4f3df5;
  --indigo-hover: #3d2ce0;
  --indigo-wash: #eef0ff;
  --lavender-border: #c3c2fb;
  --lilac-border: #dcdefc;

  /* ---------- Functional status (muted, ledger-style — strength/weakness meaning only) ---------- */
  --positive: #0f7a5c;
  --positive-wash: #e8f5f0;
  --caution: #ae4a17;
  --caution-wash: #fbeee4;

  /* ---------- Radius ---------- */
  --radius: 4px;
  --radius-md: 8px;
  --radius-tag: 9999px;

  /* ---------- Type ---------- */
  --font-sans: "Inter Tight", "Noto Sans JP", -apple-system, BlinkMacSystemFont, "Hiragino Sans",
    "Hiragino Kaku Gothic ProN", "Yu Gothic", "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  /* ---------- Layout ---------- */
  --w-narrow: 640px;
  --w-wide: 1080px;
  --header-h: 64px;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font-sans);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img,
svg {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
}

h1,
h2,
h3,
p,
ul,
ol {
  margin: 0;
}

/* ---------- Layout ---------- */

.page {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--canvas);
}

.container {
  width: 100%;
  max-width: var(--w-narrow);
  margin: 0 auto;
  padding: 0 20px;
}

.container.wide {
  max-width: var(--w-wide);
}

.header {
  position: sticky;
  top: 0;
  z-index: 20;
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--frost);
}

.header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 15px;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.brand .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--indigo);
  flex-shrink: 0;
}

.nav-links {
  display: none;
  align-items: center;
  gap: 28px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--steel);
}

.nav-links a {
  transition: color 0.15s ease;
}

.nav-links a:hover {
  color: var(--ink);
}

.header-cta {
  display: flex;
  align-items: center;
  gap: 10px;
}

@media (min-width: 760px) {
  .nav-links {
    display: flex;
  }
}

.footer {
  margin-top: auto;
  padding: 40px 20px 44px;
  background: var(--band);
  border-top: 1px solid var(--frost);
}

.footer .container {
  text-align: center;
}

.footer p {
  color: var(--steel);
  font-size: 12px;
  line-height: 1.9;
}

.footer-links {
  margin-bottom: 14px;
  font-size: 13px;
  color: var(--slate);
}

.footer a {
  color: var(--indigo);
}

.footer a:hover {
  color: var(--indigo-hover);
}

.footer-copyright {
  color: var(--smoke);
  font-size: 11.5px;
  margin-top: 10px;
}

/* ---------- Hero / Landing ---------- */

.hero {
  position: relative;
  padding: 64px 20px 48px;
  text-align: center;
  background: radial-gradient(ellipse 70% 55% at 50% -8%, rgba(79, 61, 245, 0.07), transparent 62%);
}

.hero .container {
  max-width: 620px;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--indigo);
  background: var(--indigo-wash);
  border: 1px solid var(--lavender-border);
  padding: 6px 14px;
  border-radius: var(--radius-tag);
  margin-bottom: 24px;
}

.hero h1 {
  font-size: clamp(28px, 6vw, 46px);
  font-weight: 600;
  line-height: 1.45;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin-bottom: 18px;
}

.hero h1 .gradient {
  color: var(--indigo);
}

.hero p.lead {
  font-size: 16px;
  color: var(--slate);
  line-height: 1.75;
  max-width: 400px;
  margin: 0 auto 28px;
}

.hero-meta {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 32px;
}

.hero-meta span {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  font-weight: 500;
  color: var(--steel);
  background: var(--canvas);
  border: 1px solid var(--frost);
  padding: 6px 12px;
  border-radius: var(--radius-tag);
}

.hero-cta-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 340px;
  margin: 0 auto;
}

@media (min-width: 540px) {
  .hero-cta-row {
    flex-direction: row;
    max-width: none;
    justify-content: center;
  }

  .hero-cta-row .btn {
    width: auto;
    min-width: 200px;
  }
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 15px 26px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, opacity 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.btn:active {
  opacity: 0.85;
}

@media (min-width: 640px) {
  .btn {
    width: auto;
  }
}

.btn-primary {
  background: var(--indigo);
  color: #ffffff;
}

.btn-primary:hover {
  background: var(--indigo-hover);
}

.btn-secondary {
  background: var(--canvas);
  color: var(--ink);
  border-color: var(--frost-strong);
}

.btn-secondary:hover {
  background: var(--band);
}

.btn-ghost {
  background: transparent;
  color: var(--indigo);
  border-color: var(--lavender-border);
}

.btn-ghost:hover {
  background: var(--indigo-wash);
}

.btn-sm {
  width: auto;
  padding: 9px 18px;
  font-size: 13px;
}

.btn[disabled] {
  opacity: 0.4;
  pointer-events: none;
}

.btn-row {
  display: flex;
  gap: 10px;
}

.btn-row .btn {
  flex: 1;
}

/* ---------- Cards / sections ---------- */

.card {
  background: var(--canvas);
  border: 1px solid var(--frost);
  border-radius: var(--radius-md);
  padding: 22px;
}

.section {
  padding: 40px 20px;
  border-top: 1px solid var(--frost);
}

.section:first-child,
.hero + .section {
  border-top: none;
}

.section-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--slate);
  letter-spacing: 0.04em;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-heading {
  font-size: clamp(20px, 3.4vw, 26px);
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.01em;
  margin-bottom: 10px;
}

.section-lead {
  font-size: 14px;
  color: var(--slate);
  line-height: 1.7;
  margin-bottom: 20px;
}

/* how-it-works steps */

.steps-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.step-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  background: var(--canvas);
  border: 1px solid var(--frost);
  border-radius: var(--radius-md);
  padding: 18px 16px;
}

.step-card-wide {
  grid-column: span 2;
  flex-direction: row;
  align-items: center;
  gap: 14px;
}

.step-card .step-icon {
  display: none;
}

.step-card .step-num {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--indigo-wash);
  border: 1px solid var(--lavender-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--indigo);
}

.step-card .step-label {
  font-size: 13.5px;
  color: var(--steel);
  line-height: 1.55;
}

@media (min-width: 860px) {
  .steps-grid {
    grid-template-columns: repeat(5, 1fr);
  }

  .step-card-wide {
    grid-column: span 1;
    flex-direction: column;
    align-items: flex-start;
  }
}

/* type preview grid on landing */

.type-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

@media (min-width: 620px) {
  .type-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.type-chip {
  display: flex;
  align-items: center;
  gap: 12px;
  border-radius: var(--radius-md);
  background: var(--canvas);
  border: 1px solid var(--frost);
  padding: 12px;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.type-chip:hover {
  border-color: var(--lavender-border);
  background: var(--indigo-wash);
}

.type-chip-icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: var(--radius);
  background: var(--band);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
}

.type-chip-avatar {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--band);
  border: 1px solid var(--frost-strong);
}

.type-chip-name {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.4;
}

/* ---------- Diagnosis flow ---------- */

.progress-wrap {
  padding: 18px 20px 0;
}

.progress-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  font-size: 12px;
  color: var(--slate);
  font-weight: 600;
}

.progress-bar {
  height: 4px;
  border-radius: var(--radius-tag);
  background: var(--frost);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  border-radius: var(--radius-tag);
  background: var(--indigo);
  transition: width 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.question-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 36px 20px 24px;
  max-width: var(--w-narrow);
  margin: 0 auto;
  width: 100%;
}

.question-sub {
  font-size: 12px;
  color: var(--smoke);
  font-weight: 500;
  margin-bottom: 10px;
}

.question-text {
  font-size: clamp(19px, 3.6vw, 24px);
  font-weight: 600;
  color: var(--ink);
  line-height: 1.55;
  letter-spacing: -0.01em;
  margin-bottom: 28px;
}

.options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.option-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  text-align: left;
  padding: 16px;
  border-radius: var(--radius-md);
  background: var(--canvas);
  border: 1px solid var(--frost);
  color: var(--ink);
  font-size: 14.5px;
  line-height: 1.55;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.option-btn:hover {
  background: var(--band);
  border-color: var(--frost-strong);
}

.option-btn.selected {
  border-color: var(--indigo);
  background: var(--indigo-wash);
}

.option-key {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--band);
  border: 1px solid var(--frost-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--slate);
}

.option-btn.selected .option-key {
  border-color: var(--indigo);
  background: var(--indigo);
  color: #ffffff;
}

.diagnosis-footer {
  padding: 8px 20px 32px;
  max-width: var(--w-narrow);
  margin: 0 auto;
  width: 100%;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--smoke);
  font-size: 13px;
  font-weight: 500;
  padding: 10px 0;
  cursor: pointer;
  background: none;
  border: none;
}

.back-link:hover {
  color: var(--slate);
}

.back-link[disabled] {
  opacity: 0.35;
  pointer-events: none;
}

/* ---------- Result page ---------- */

.result-hero {
  text-align: center;
  padding: 48px 20px 36px;
  background: radial-gradient(ellipse 70% 55% at 50% -8%, rgba(79, 61, 245, 0.07), transparent 62%);
}

.result-avatar-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}

.result-avatar {
  width: 128px;
  height: 128px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--band);
  border: 1px solid var(--frost-strong);
}

.result-kicker {
  font-size: 13px;
  color: var(--slate);
  font-weight: 500;
  margin-bottom: 10px;
}

.result-type-name {
  font-size: clamp(24px, 5vw, 34px);
  font-weight: 700;
  line-height: 1.4;
  color: var(--ink);
  letter-spacing: -0.01em;
  margin-bottom: 6px;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.result-type-en {
  font-size: 12px;
  color: var(--smoke);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 18px;
}

.result-tagline {
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 4px;
}

.result-oneliner {
  font-size: 13.5px;
  color: var(--slate);
  line-height: 1.75;
  max-width: 360px;
  margin: 12px auto 0;
}

.type-id-badge {
  display: inline-block;
  margin-top: 18px;
  padding: 6px 14px;
  border-radius: var(--radius-tag);
  background: var(--canvas);
  border: 1px solid var(--frost-strong);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--steel);
  font-weight: 700;
}

/* axis bars */

.axis-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.axis-row .axis-labels {
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
  font-weight: 500;
  margin-bottom: 7px;
  color: var(--slate);
}

.axis-row .axis-labels .active-label {
  font-weight: 700;
  color: var(--ink);
}

.axis-track {
  position: relative;
  height: 6px;
  border-radius: var(--radius-tag);
  background: var(--frost);
  overflow: hidden;
}

.axis-fill {
  position: absolute;
  inset: 0;
  width: 0%;
  border-radius: var(--radius-tag);
  background: var(--indigo);
  transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

/* content lists */

.pill-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pill-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 14px;
  color: var(--steel);
  line-height: 1.7;
}

.pill-item .mark {
  flex-shrink: 0;
  margin-top: 2px;
  width: 18px;
  height: 18px;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
}

.pill-item.strength .mark {
  background: var(--positive-wash);
  color: var(--positive);
}

.pill-item.weakness .mark {
  background: var(--caution-wash);
  color: var(--caution);
}

.pill-item.neutral .mark {
  background: var(--indigo-wash);
  color: var(--indigo);
}

.callout {
  border-radius: var(--radius-md);
  padding: 18px;
  font-size: 13.5px;
  line-height: 1.75;
  color: var(--steel);
}

.callout-warn {
  background: var(--caution-wash);
  border: 1px solid #f0d2be;
}

.callout-info {
  background: var(--indigo-wash);
  border: 1px solid var(--lilac-border);
}

/* prompt box */

.prompt-box {
  position: relative;
  background: var(--band);
  border: 1px solid var(--frost-strong);
  border-radius: var(--radius-md);
  padding: 18px;
  max-height: 260px;
  overflow-y: auto;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.75;
  color: var(--steel);
  white-space: pre-wrap;
  word-break: break-word;
}

.copy-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%) translateY(20px);
  background: var(--ink);
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
  padding: 12px 20px;
  border-radius: var(--radius);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 50;
}

.copy-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* share */

.share-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.share-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  padding: 14px 6px;
  border-radius: var(--radius-md);
  background: var(--canvas);
  border: 1px solid var(--frost);
  color: var(--steel);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.share-btn:hover {
  border-color: var(--frost-strong);
  background: var(--band);
}

.share-btn .icon {
  font-size: 18px;
  color: var(--ink);
}

.share-card-preview {
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--frost-strong);
}

.share-card-preview canvas {
  width: 100%;
  height: auto;
  display: block;
}

/* CTA / cross-sell */

.cta-card {
  background: var(--periwinkle-wash);
  border: 1px solid var(--lavender-border);
  border-radius: var(--radius-md);
  padding: 22px;
}

.cta-hook {
  font-size: 11px;
  font-weight: 700;
  color: var(--indigo);
  letter-spacing: 0.01em;
  margin-bottom: 8px;
}

.cta-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.cta-card h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 0;
}

.pr-badge {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--slate);
  background: var(--canvas);
  border: 1px solid var(--frost-strong);
  border-radius: var(--radius-tag);
  padding: 2px 8px;
}

.cta-card-note {
  font-size: 11px;
  color: var(--slate);
  margin-top: 12px;
  margin-bottom: 0;
}

.cta-card-secondary {
  background: var(--canvas);
  border-color: var(--frost);
}

.cta-card p {
  font-size: 13.5px;
  color: var(--steel);
  line-height: 1.7;
  margin-bottom: 16px;
}

/* retake */

.retake-link {
  display: block;
  text-align: center;
  padding: 16px;
  color: var(--slate);
  font-weight: 500;
  font-size: 13px;
}

.retake-link:hover {
  color: var(--indigo);
}

/* disclaimer */

.disclaimer {
  font-size: 11.5px;
  color: var(--smoke);
  line-height: 1.85;
  padding: 18px;
  background: var(--band);
  border-radius: var(--radius-md);
  border: 1px solid var(--frost);
}

/* utility */

.text-center {
  text-align: center;
}
.mt-8 {
  margin-top: 8px;
}
.mt-16 {
  margin-top: 16px;
}
.mt-24 {
  margin-top: 24px;
}
.mb-8 {
  margin-bottom: 8px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.visually-hide {
  display: none !important;
}

/* skeleton / loading */

.loading-dots::after {
  content: "";
  display: inline-block;
  width: 1em;
}

/* fade-in animation for content blocks */

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-up {
  animation: fadeUp 0.35s ease both;
}

/* ---------- Wide desktop refinements ---------- */

@media (min-width: 860px) {
  .section {
    padding: 56px 20px;
  }

  .result-hero,
  .hero {
    padding-top: 80px;
    padding-bottom: 56px;
  }
}
