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

:root {
  --text: #1a1a1a;
  --text-muted: #5f5f5f;
  --border: #e2e2e2;
  --bg: #ffffff;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

html {
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
}

.hidden {
  display: none !important;
}

/* ── Site header ───────────────────────────────── */

.site-header {
  background: #1E3059;
  height: 60px;
  position: relative;
  overflow: visible;
}

.site-header .container {
  position: relative;
  height: 100%;
}

.site-badge {
  position: absolute;
  right: 0;
  top: 0;
  height: 144px;
  width: auto;
  z-index: 10;
}

.container {
  max-width: 780px;
  margin: 0 auto;
  padding: 0 28px;
}

/* ── Buttons ───────────────────────────────────── */

.btn-primary {
  display: inline-block;
  background: var(--text);
  color: #fff;
  border: 2px solid var(--text);
  padding: 12px 28px;
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 600;
  border-radius: 4px;
  cursor: pointer;
  transition: opacity 0.15s;
}

.btn-primary:hover {
  opacity: 0.8;
}

.btn-secondary {
  display: inline-block;
  background: transparent;
  color: var(--text);
  border: 2px solid var(--text);
  padding: 11px 26px;
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 600;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.btn-secondary:hover {
  background: var(--text);
  color: #fff;
}

/* ── Intro ─────────────────────────────────────── */

#intro {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 100px 0 64px;
}

#intro .container {
  max-width: 640px;
}

#intro h1 {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 28px;
}

#intro p {
  margin-bottom: 18px;
  line-height: 1.75;
  color: var(--text);
}

#intro p:last-of-type {
  margin-bottom: 0;
}

#start-btn {
  margin-top: 32px;
}

/* ── Scale bar ─────────────────────────────────── */

#scale-bar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 10px 0;
}

.scale-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.page-indicator {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
}

.progress-text {
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* ── Assessment ────────────────────────────────── */

#assessment {
  padding: 100px 0 80px;
}

.pillar-section {
  margin-bottom: 60px;
}

.pillar-header {
  border-left: 4px solid var(--pillar-color);
  padding-left: 16px;
  margin-bottom: 36px;
}

.pillar-header h2 {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.element-group {
  margin-bottom: 40px;
}

.element-header {
  padding-bottom: 12px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--border);
}

.element-label {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.element-title {
  display: block;
  font-size: 0.95rem;
  font-weight: 600;
}

/* ── Item rows ─────────────────────────────────── */

.item-row {
  padding: 16px 0;
  border-bottom: 1px solid #f2f2f2;
}

.item-row:last-child {
  border-bottom: none;
}

.item-text {
  display: block;
  font-size: 0.97rem;
  line-height: 1.55;
  margin-bottom: 10px;
}

/* ── Radio buttons ─────────────────────────────── */

.radio-group {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.radio-label {
  cursor: pointer;
}

.radio-label input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.radio-btn {
  display: block;
  text-align: center;
  padding: 9px 6px;
  border-radius: 4px;
  border: 1.5px solid #d4d4d4;
  font-size: 0.8rem;
  font-weight: 500;
  color: #777;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: border-color 0.12s, color 0.12s, background 0.12s;
  user-select: none;
  cursor: pointer;
}

.radio-label:hover .radio-btn {
  border-color: #aaa;
  color: #555;
}

.radio-label input[type="radio"]:checked + .radio-btn {
  background: var(--pillar-color);
  border-color: var(--pillar-color);
  color: var(--pillar-on-color, #fff);
}

.radio-label input[type="radio"]:focus-visible + .radio-btn {
  outline: 3px solid #4a90d9;
  outline-offset: 2px;
}

/* ── Validation ────────────────────────────────── */

.validation-msg {
  background: #fff8e6;
  border: 1px solid #e8c84a;
  border-radius: 4px;
  padding: 12px 16px;
  font-size: 0.9rem;
  color: #6b4800;
  margin-top: 24px;
}

.nav-row {
  display: flex;
  align-items: center;
  margin-top: 40px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}

.nav-spacer {
  flex: 1;
}

/* ── Archetype hero ────────────────────────────── */

.archetype-hero {
  padding-bottom: 48px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 52px;
}

.archetype-hero-identity {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
  background: #E8E6DF;
  border-radius: 999px;
  padding: 10px 40px 10px 10px;
}

.archetype-hero-image {
  height: 5rem;
  width: auto;
  display: block;
  flex-shrink: 0;
}

.archetype-hero-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.archetype-hero-text .archetype-label {
  margin-bottom: 3px;
}

.archetype-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.archetype-name {
  font-size: 2.25rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 0;
}

.archetype-desc {
  font-size: 1rem;
  line-height: 1.75;
  max-width: 640px;
  margin-bottom: 16px;
}

.archetype-growth-edge {
  font-size: 0.9rem;
  color: var(--text-muted);
  padding-left: 16px;
  border-left: 3px solid var(--border);
  margin: 0;
  line-height: 1.5;
}

.archetype-suggestions {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.archetype-suggestions-label {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.archetype-suggestion-cards {
  display: flex;
  gap: 14px;
}

.archetype-suggestion-card {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 16px 18px;
}

.archetype-suggestion-name {
  display: block;
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.archetype-suggestion-teaser {
  display: block;
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ── Results ───────────────────────────────────── */

#results {
  padding: 100px 0 80px;
}

.results-header {
  margin-bottom: 44px;
}

.results-header h2 {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

.results-header p {
  color: var(--text-muted);
  font-size: 0.97rem;
}

/* ── Pillar bars ───────────────────────────────── */

.pillar-bars {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 14px;
}

.bar-wrapper {
  width: 100%;
}

.bar-row {
  display: flex;
  align-items: center;
  gap: 16px;
}

.bar-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  width: 210px;
  flex-shrink: 0;
  line-height: 1.3;
}

.bar-track {
  flex: 1;
  height: 26px;
  background: #efefef;
  border-radius: 999px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  min-width: 8px;
  border-radius: 999px;
  transition: width 0.9s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.pillar-note {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: center;
  font-style: italic;
  margin-bottom: 52px;
}

/* ── Treemap ───────────────────────────────────── */

.treemap-container {
  margin-bottom: 14px;
}

.treemap-toggle {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
}

.treemap-toggle-btn {
  padding: 5px 14px;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: transparent;
  font-family: var(--font);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-muted);
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.treemap-toggle-btn:hover {
  border-color: var(--text);
  color: var(--text);
}

.treemap-toggle-btn.active {
  background: var(--text);
  border-color: var(--text);
  color: #fff;
}

.treemap {
  display: flex;
  height: 600px;
  gap: 8px;
  margin-bottom: 8px;
  align-items: flex-end;
}

.treemap-pillar {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  overflow: hidden;
}

.treemap-cell {
  background: var(--pillar-color);
  border-radius: 2px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 5px 7px;
  cursor: default;
  transition: background-color 0.3s ease, filter 0.15s;
  min-height: 0;
}

.treemap-cell:hover {
  filter: brightness(1.12);
}

.treemap-cell-score {
  align-self: flex-end;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
  flex-shrink: 0;
}

.treemap-cell-label {
  font-size: 0.65rem;
  font-weight: 600;
  line-height: 1.3;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.treemap-labels {
  display: flex;
  gap: 8px;
}

.treemap-label {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  line-height: 1.3;
  padding: 0 2px;
  min-width: 0;
  overflow: hidden;
}

.treemap-label-name {
  display: block;
}

.treemap-pillar-tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.63rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  margin-top: 5px;
  white-space: nowrap;
}

.treemap-pillar-tag--top {
  color: #fff;
}

.treemap-pillar-tag--growth {
  background: #e8e8e8;
  color: #555;
}

/* ── Element spotlight ─────────────────────────── */

.element-spotlight {
  margin-bottom: 52px;
}

.spotlight-section {
  margin-bottom: 44px;
}

.spotlight-heading {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 6px;
}

.spotlight-sub {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 20px;
}

.element-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.element-card {
  border: 1px solid var(--border);
  border-top: 4px solid var(--pillar-color);
  border-radius: 6px;
  padding: 20px;
}

.element-card-statement {
  font-size: 0.84rem;
  line-height: 1.55;
  color: var(--text);
  margin-bottom: 12px;
}

.element-card-prompt {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.element-card-label {
  display: block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.element-card-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 10px;
  line-height: 1.3;
}

.element-card-bullets {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.element-card-bullets li {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.45;
  padding-left: 14px;
  position: relative;
}

.element-card-bullets li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: var(--pillar-text-color, var(--pillar-color));
  font-weight: 700;
}

/* ── Synthesis section ─────────────────────────── */

.synthesis-section {
  background: #f7f7f5;
  border-radius: 8px;
  padding: 32px 36px;
  margin-bottom: 52px;
}

.synthesis-heading {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 16px;
}

.synthesis-content p {
  font-size: 0.95rem;
  line-height: 1.75;
  color: var(--text);
  margin-bottom: 14px;
}

.synthesis-content p:last-child {
  margin-bottom: 0;
}

/* ── Bridge section ────────────────────────────── */

.bridge-section {
  border-top: 1px solid var(--border);
  padding-top: 48px;
}

.bridge-section h2 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 16px;
}

.bridge-section p {
  max-width: 600px;
  line-height: 1.75;
  margin-bottom: 14px;
  color: var(--text);
}

.bridge-section .btn-secondary {
  margin-top: 10px;
}

/* ── Responsive ────────────────────────────────── */

@media (max-width: 640px) {
  html {
    font-size: 16px;
  }

  .radio-group {
    grid-template-columns: repeat(2, 1fr);
  }

  .element-cards {
    grid-template-columns: 1fr;
  }

  #intro h1 {
    font-size: 1.6rem;
  }

  .results-header h2 {
    font-size: 1.4rem;
  }
}
