/* ============================================================
   資本力チェッカー
   - nariwai-lp のデザイントークン踏襲
   - ライト / ダーク両対応（prefers-color-scheme）
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Light (default) */
  --bg:        #ffffff;
  --surface:   #f7f7f5;
  --surface-2: #efeeeb;
  --border:    #d8d8d4;
  --text:      #1a1a1a;
  --muted:     #707070;
  --accent:    #2d2d2d;
  --accent-fg: #ffffff;

  --chart-grid:   #d8d8d4;
  --chart-axis:   #b8b8b4;
  --chart-fill:   rgba(45, 45, 45, 0.18);
  --chart-stroke: #2d2d2d;
  --chart-dot:    #1a1a1a;

  --kenji-low:  #4a8a5e;
  --kenji-mid:  #c89548;
  --kenji-high: #c14d4d;

  --pyramid-base-color: #6b8a52;
  --pyramid-top-color:  #c89548;

  --radius: 6px;
  --font:   'Noto Sans JP', 'Hiragino Sans', 'Yu Gothic', sans-serif;
  --max:    720px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:        #141413;
    --surface:   #1f1f1d;
    --surface-2: #2a2a27;
    --border:    #3a3a35;
    --text:      #f0ede5;
    --muted:     #a8a59b;
    --accent:    #f0ede5;
    --accent-fg: #141413;

    --chart-grid:   #3a3a35;
    --chart-axis:   #55534c;
    --chart-fill:   rgba(240, 237, 229, 0.22);
    --chart-stroke: #f0ede5;
    --chart-dot:    #f0ede5;

    --kenji-low:  #7ab48b;
    --kenji-mid:  #e0b06a;
    --kenji-high: #e07474;

    --pyramid-base-color: #a8c08a;
    --pyramid-top-color:  #e0b06a;
  }
}

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.8;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }

/* ===== Layout ===== */
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 20px; }
main  { padding: 40px 0 80px; }

.view { display: none; }
.view--active { display: block; }

.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 56px 0;
}

/* ===== Section ===== */
.section { padding: 8px 0; }

.section-label {
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  color: var(--muted);
  margin-bottom: 14px;
}

.section-title {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  line-height: 1.5;
  margin-bottom: 24px;
}

.section-lead {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 28px;
  line-height: 1.9;
}

/* ============================================================
   TOP
   ============================================================ */
.hero {
  padding: 32px 0 24px;
  text-align: center;
}

.hero-eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.24em;
  color: var(--muted);
  margin-bottom: 14px;
}

.hero-title {
  font-size: 1.9rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  line-height: 1.35;
  margin-bottom: 18px;
}

.hero-sub {
  font-size: 0.95rem;
  color: var(--muted);
  line-height: 2;
  margin-bottom: 32px;
}

.cta {
  display: inline-block;
  padding: 16px 48px;
  background: var(--accent);
  color: var(--accent-fg);
  border: none;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  transition: opacity 0.15s;
  min-height: 48px;
  line-height: 1.4;
  text-decoration: none;
}
.cta:hover { opacity: 0.82; }

.cta--large {
  display: block;
  width: 100%;
  max-width: 360px;
  margin: 24px auto 0;
  padding: 18px 24px;
  text-align: center;
  font-size: 1rem;
}

.meta-list {
  list-style: none;
  display: flex;
  justify-content: center;
  gap: 28px;
  margin: 32px 0 0;
  font-size: 0.8rem;
  color: var(--muted);
  letter-spacing: 0.08em;
  flex-wrap: wrap;
}

.about-capitals {
  list-style: none;
  border-top: 1px solid var(--border);
}
.about-capitals li {
  padding: 14px 0 14px 20px;
  border-bottom: 1px solid var(--border);
  font-size: 0.92rem;
  position: relative;
}
.about-capitals li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 26px;
  width: 8px;
  height: 1px;
  background: var(--text);
}
.about-capitals strong {
  font-weight: 700;
  margin-right: 8px;
}
.about-capitals .neg {
  color: var(--kenji-high);
  font-weight: 700;
}

.check-list {
  list-style: none;
  border-top: 1px solid var(--border);
}
.check-list li {
  padding: 14px 0 14px 20px;
  border-bottom: 1px solid var(--border);
  font-size: 0.92rem;
  position: relative;
  line-height: 1.8;
}
.check-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 26px;
  width: 8px;
  height: 1px;
  background: var(--text);
}

/* ============================================================
   QUIZ
   ============================================================ */
.quiz-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 0 24px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 40px;
}

.back-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  transition: background 0.15s, border-color 0.15s, opacity 0.15s;
}
.back-btn:hover:not(:disabled) {
  background: var(--surface);
  border-color: var(--text);
}
.back-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.progress {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.progress-text {
  font-size: 0.72rem;
  letter-spacing: 0.15em;
  color: var(--muted);
  text-align: right;
}
.progress-bar {
  height: 4px;
  background: var(--surface-2);
  border-radius: 2px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width 0.3s ease;
}

.question {
  padding: 24px 0 32px;
  text-align: center;
}
.question-label {
  font-size: 0.7rem;
  letter-spacing: 0.24em;
  color: var(--muted);
  margin-bottom: 14px;
}
.question-text {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  line-height: 1.7;
  max-width: 560px;
  margin: 0 auto;
}

.answers {
  display: flex;
  flex-direction: column;
  gap: 10px;
  list-style: none;
  margin-top: 8px;
}

.answer-btn {
  width: 100%;
  padding: 16px 20px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-align: center;
  transition: background 0.15s, border-color 0.15s, transform 0.05s;
  min-height: 52px;
}
.answer-btn:hover {
  background: var(--surface);
  border-color: var(--text);
}
.answer-btn:active { transform: scale(0.98); }

.answer-btn--selected {
  background: var(--accent);
  color: var(--accent-fg);
  border-color: var(--accent);
}

/* ============================================================
   RESULT
   ============================================================ */
.result-header {
  text-align: center;
  padding: 8px 0 16px;
}
.result-eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.24em;
  color: var(--muted);
  margin-bottom: 12px;
}
.result-title {
  font-size: 1.6rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  line-height: 1.4;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 20px;
  margin-top: 32px;
}

/* ----- Radar ----- */
.radar-wrap {
  display: flex;
  justify-content: center;
  margin: 8px 0 4px;
}
#radar-svg {
  width: 100%;
  max-width: 360px;
  height: auto;
  display: block;
}
.radar-grid {
  fill: none;
  stroke: var(--chart-grid);
  stroke-width: 1;
}
.radar-axis {
  stroke: var(--chart-axis);
  stroke-width: 1;
}
.radar-score {
  fill: var(--chart-fill);
  stroke: var(--chart-stroke);
  stroke-width: 2;
  stroke-linejoin: round;
}
.radar-dot {
  fill: var(--chart-dot);
}
.radar-label {
  font-size: 13px;
  font-weight: 700;
  fill: var(--text);
  letter-spacing: 0.05em;
}
.radar-score-label {
  font-size: 11px;
  fill: var(--muted);
  letter-spacing: 0.03em;
}

/* ----- Kenji Gauge ----- */
.kenji-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 14px;
}
.kenji-title {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}
.kenji-value {
  font-size: 1.1rem;
  font-weight: 900;
  letter-spacing: 0.05em;
}
.kenji-bar {
  height: 12px;
  background: var(--surface-2);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.kenji-fill {
  height: 100%;
  width: 0%;
  background: var(--kenji-low);
  transition: width 0.4s ease, background 0.3s;
}
.kenji-fill[data-level="mid"]  { background: var(--kenji-mid); }
.kenji-fill[data-level="high"] { background: var(--kenji-high); }

.kenji-msg {
  margin-top: 14px;
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.9;
}

/* ----- Pyramid ----- */
.pyramid-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: center;
}
#pyramid-svg {
  width: 100%;
  max-width: 280px;
  height: auto;
  margin: 0 auto;
}
.pyramid-roof {
  fill: var(--pyramid-top-color);
  stroke: var(--chart-stroke);
  stroke-width: 1.5;
}
.pyramid-base {
  fill: var(--pyramid-base-color);
  stroke: var(--chart-stroke);
  stroke-width: 1.5;
}
.pyramid-sep {
  stroke: var(--chart-stroke);
  stroke-width: 1.5;
}
.pyramid-text {
  font-size: 13px;
  font-weight: 700;
  fill: var(--text);
  letter-spacing: 0.05em;
}

.pyramid-detail {
  font-size: 0.82rem;
}
.pyramid-group {
  margin-bottom: 18px;
}
.pyramid-group:last-child { margin-bottom: 0; }
.pyramid-group-title {
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  color: var(--muted);
  font-weight: 700;
  margin-bottom: 6px;
}
.pyramid-group ul {
  list-style: none;
}
.pyramid-group li {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}
.pyramid-group li:last-child { border-bottom: none; }

/* ----- Summary ----- */
.summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 8px;
}
.summary-block h3 {
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  color: var(--muted);
  margin-bottom: 10px;
  font-weight: 700;
}
.summary-block ul { list-style: none; }
.summary-block li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.92rem;
  font-weight: 500;
}
.summary-block li:last-child { border-bottom: none; }
.summary-block .score {
  margin-left: auto;
  font-weight: 700;
  letter-spacing: 0.05em;
}
.bullet {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
}
.bullet--up   { background: var(--kenji-low); }
.bullet--down { background: var(--kenji-high); }

/* ----- CTA on result ----- */
.cta-card {
  margin-top: 32px;
  padding: 28px 20px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  text-align: center;
  background: var(--surface);
}
.cta-card p {
  font-size: 0.95rem;
  line-height: 1.9;
  letter-spacing: 0.03em;
}
.cta-card strong {
  display: block;
  font-size: 1.05rem;
  margin-bottom: 8px;
}

.retry-btn {
  display: block;
  margin: 32px auto 0;
  padding: 12px 32px;
  background: none;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius);
  font-size: 0.88rem;
  letter-spacing: 0.1em;
  transition: background 0.15s, border-color 0.15s;
}
.retry-btn:hover {
  background: var(--surface);
  border-color: var(--text);
}

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 28px 20px;
  text-align: center;
  font-size: 0.75rem;
  color: var(--muted);
  letter-spacing: 0.05em;
}
.site-footer p { margin-bottom: 6px; }
.site-footer p:last-child { margin-bottom: 0; }
.site-footer a {
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: var(--border);
}
.site-footer a:hover { color: var(--text); }

.social-links {
  list-style: none;
  display: flex;
  gap: 8px;
  justify-content: center;
  margin: 0 auto 18px;
  padding: 0;
}
.social-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: var(--muted);
  transition: color 0.15s, background 0.15s;
}
.social-links a:hover {
  color: var(--text);
  background: var(--surface);
}
.social-links svg {
  width: 18px;
  height: 18px;
}

/* ============================================================
   Mobile
   ============================================================ */
@media (max-width: 600px) {
  main { padding: 24px 0 64px; }

  .hero { padding: 16px 0 16px; }
  .hero-title { font-size: 1.5rem; }
  .hero-sub { font-size: 0.9rem; }

  .divider { margin: 44px 0; }

  .section-title { font-size: 1.1rem; }
  .result-title { font-size: 1.3rem; }

  .pyramid-wrap {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .summary-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .card { padding: 22px 16px; }

  .question-text { font-size: 1.05rem; }

  .answer-btn { padding: 14px 16px; min-height: 48px; }

  .meta-list { gap: 16px; font-size: 0.75rem; }
}
