:root {
  --bg: #f1eadf;
  --bg-deep: #d8c5ab;
  --paper: rgba(255, 250, 243, 0.88);
  --paper-strong: #fffaf2;
  --ink: #241d17;
  --muted: #6d6052;
  --accent: #a23a2c;
  --accent-soft: #d57053;
  --gold: #c59a46;
  --line: rgba(61, 42, 27, 0.12);
  --shadow: 0 30px 80px rgba(76, 49, 24, 0.18);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Outfit", "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(194, 140, 65, 0.28), transparent 28%),
    radial-gradient(circle at 85% 15%, rgba(162, 58, 44, 0.16), transparent 25%),
    linear-gradient(135deg, #efe3d1 0%, #f6f1ea 42%, #e9dcc8 100%);
}

body::before,
body::after {
  content: "";
  position: fixed;
  pointer-events: none;
  z-index: 0;
  border-radius: 999px;
  filter: blur(16px);
}

body::before {
  width: 320px;
  height: 320px;
  left: -120px;
  bottom: 8vh;
  background: rgba(162, 58, 44, 0.14);
}

body::after {
  width: 280px;
  height: 280px;
  right: -80px;
  top: 16vh;
  background: rgba(197, 154, 70, 0.15);
}

.page-shell {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 44px 0 56px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(280px, 0.7fr);
  gap: 24px;
  align-items: stretch;
  margin-bottom: 28px;
}

.hero-copy,
.hero-panel,
.quiz-card {
  border: 1px solid rgba(255, 255, 255, 0.45);
  background: var(--paper);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
}

.hero-copy,
.hero-panel {
  border-radius: 28px;
  padding: 30px;
}

.eyebrow,
.section-kicker,
.panel-label,
.result-label {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 0.82rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 700;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-family: "Noto Serif SC", serif;
  font-weight: 700;
}

h1 {
  font-size: clamp(2.2rem, 4vw, 3.8rem);
  line-height: 1.1;
}

h2 {
  font-size: clamp(1.5rem, 2.6vw, 2.2rem);
  line-height: 1.2;
}

.hero-text,
.lead,
.leader-summary,
.leader-warning,
.profile-description,
.note-box li,
.dimension-list li,
.question-prompt,
.source-link,
.axis-line {
  color: var(--muted);
  line-height: 1.75;
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 26px;
}

.hero-tags span,
.trait-badge {
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  font-size: 0.95rem;
}

.panel-card {
  height: 100%;
  padding: 22px;
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255, 248, 237, 0.92), rgba(240, 226, 203, 0.84)),
    repeating-linear-gradient(
      -35deg,
      rgba(197, 154, 70, 0.06) 0,
      rgba(197, 154, 70, 0.06) 8px,
      transparent 8px,
      transparent 18px
    );
  border: 1px solid rgba(162, 58, 44, 0.12);
}

.dimension-list,
.note-box ul {
  margin: 0;
  padding-left: 18px;
}

.dimension-list li + li,
.note-box li + li {
  margin-top: 10px;
}

.quiz-card {
  border-radius: 30px;
  padding: 30px;
}

.view {
  display: none;
}

.view.active {
  display: block;
  animation: fadeUp 360ms ease;
}

.section-head {
  margin-bottom: 18px;
}

.note-box,
.result-banner,
.traits-box,
.chart-wrap,
.leader-card,
.score-bars {
  border: 1px solid var(--line);
  background: var(--paper-strong);
  border-radius: 24px;
}

.note-box {
  margin: 24px 0 30px;
  padding: 20px 22px;
}

.note-box p {
  margin: 0 0 8px;
  font-weight: 700;
}

.primary-btn,
.ghost-btn,
.choice-btn {
  appearance: none;
  border: 0;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
  font-family: inherit;
}

.primary-btn,
.ghost-btn {
  padding: 14px 22px;
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 600;
}

.primary-btn {
  color: #fff7f0;
  background: linear-gradient(135deg, var(--accent), #7f2418);
  box-shadow: 0 16px 32px rgba(162, 58, 44, 0.28);
}

.ghost-btn {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid var(--line);
}

.primary-btn:hover,
.ghost-btn:hover,
.choice-btn:hover {
  transform: translateY(-2px);
}

.progress-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
  margin-bottom: 18px;
}

.progress-meta {
  font-weight: 600;
  color: var(--accent);
}

.progress-track {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: rgba(138, 109, 82, 0.12);
  overflow: hidden;
}

.progress-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--gold), var(--accent-soft));
}

.question-body {
  padding: 28px 0 22px;
}

.question-prompt {
  margin: 0 0 22px;
  font-size: clamp(1.2rem, 2vw, 1.45rem);
  color: var(--ink);
  line-height: 1.6;
}

.choices {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.choice-btn {
  display: block;
  text-align: left;
  min-height: 140px;
  padding: 22px 20px;
  border-radius: 22px;
  border: 1px solid rgba(162, 58, 44, 0.12);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(247, 240, 231, 0.96));
}

.choice-btn strong {
  display: block;
  margin-bottom: 10px;
  font-size: 1.05rem;
  color: var(--accent);
}

.choice-btn span {
  color: var(--muted);
  line-height: 1.7;
}

.question-actions,
.result-actions {
  display: flex;
  justify-content: flex-start;
  margin-top: 10px;
}

.result-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.65fr);
  gap: 20px;
  margin-top: 20px;
}

.result-main {
  display: grid;
  gap: 18px;
}

.result-banner,
.traits-box,
.chart-wrap,
.leader-card,
.score-bars {
  padding: 22px;
}

.leader-title {
  margin-top: 8px;
  color: var(--accent);
  font-weight: 600;
}

.leader-summary {
  margin: 14px 0 0;
}

.leader-warning {
  margin: 14px 0 0;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(162, 58, 44, 0.07);
  color: #7f2418;
  font-weight: 500;
}

.trait-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 14px 0 12px;
}

.trait-badge {
  background: rgba(162, 58, 44, 0.06);
}

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

.chart-head span {
  color: var(--muted);
  font-size: 0.92rem;
}

#radarChart {
  width: 100%;
  height: auto;
  display: block;
}

.leader-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.portrait-frame {
  overflow: hidden;
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(197, 154, 70, 0.2), rgba(162, 58, 44, 0.12)),
    #efe6d9;
  aspect-ratio: 4 / 5;
}

.portrait-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.source-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.source-link:hover {
  text-decoration: underline;
}

.bars-container {
  display: grid;
  gap: 16px;
  margin-top: 16px;
}

.bar-row {
  display: grid;
  grid-template-columns: 158px minmax(0, 1fr) 74px;
  gap: 14px;
  align-items: center;
}

.bar-label {
  font-weight: 600;
}

.bar-track {
  position: relative;
  height: 14px;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    rgba(162, 58, 44, 0.18) 0%,
    rgba(255, 255, 255, 0.9) 50%,
    rgba(197, 154, 70, 0.18) 100%
  );
  overflow: hidden;
}

.bar-track::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 50%;
  width: 1px;
  background: rgba(36, 29, 23, 0.16);
}

.bar-fill {
  position: absolute;
  top: 1px;
  bottom: 1px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent-soft), var(--gold));
}

.bar-value {
  text-align: right;
  color: var(--muted);
  font-weight: 600;
}

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

@media (max-width: 920px) {
  .hero,
  .result-layout {
    grid-template-columns: 1fr;
  }

  .choices {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .page-shell {
    width: min(100% - 20px, 100%);
    padding-top: 20px;
    padding-bottom: 28px;
  }

  .hero-copy,
  .hero-panel,
  .quiz-card {
    padding: 22px;
    border-radius: 24px;
  }

  .bar-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .chart-head,
  .progress-row {
    flex-direction: column;
    align-items: flex-start;
  }
}
