/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #F7F7FA;
  --bg2: #FFFFFF;
  --bg3: #F0F0F5;
  --border: rgba(0,0,0,0.09);
  --text: #18181E;
  --text-dim: #60607A;
  --accent: #5B4ECC;
  --accent2: #3D8A76;
  --s-color: #4A72A0;
  --e-color: #C26860;
  --a-color: #C8663A;
  --l-color: #3D8A76;
  --radius: 12px;
  --radius-lg: 20px;
  --font: 'Inter', system-ui, sans-serif;
  --mono: 'JetBrains Mono', monospace;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; font: inherit; color: inherit; }
p { color: var(--text-dim); }
strong { color: var(--text); }
em { color: var(--text); font-style: italic; }

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ===== NAV ===== */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(247,247,250,0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav__inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav__logo {
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.5px;
  color: var(--text);
  cursor: pointer;
}

.nav__links {
  display: flex;
  gap: 4px;
  flex: 1;
}

.nav__link {
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 14px;
  color: var(--text-dim);
  transition: color 0.2s, background 0.2s;
  cursor: pointer;
}
.nav__link:hover, .nav__link.active {
  color: var(--text);
  background: var(--bg3);
}

.nav__burger {
  display: none;
  font-size: 20px;
  padding: 4px 8px;
}

@media (max-width: 640px) {
  .nav__links { display: none; }
  .nav__links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    background: var(--bg2);
    border-bottom: 1px solid var(--border);
    padding: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
  }
  .nav__burger { display: block; margin-left: auto; }
}

/* ===== VIEWS ===== */
.view { display: none; padding-bottom: 80px; }
.view.active { display: block; }

/* ===== HERO ===== */
.hero {
  min-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 80px 24px;
}

.hero__tag {
  display: inline-block;
  padding: 6px 16px;
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 32px;
  letter-spacing: 0.5px;
}

.hero__title {
  font-size: clamp(28px, 4vw, 52px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -1.5px;
  color: var(--text);
  margin-bottom: 28px;
  max-width: 600px;
}

.hero__sub {
  font-size: clamp(16px, 2vw, 20px);
  color: var(--text-dim);
  margin-bottom: 48px;
  max-width: 500px;
}

.hero__list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 48px;
  text-align: left;
  max-width: 520px;
}
.hero__list li {
  font-size: 16px;
  color: var(--text-dim);
  padding-left: 20px;
  position: relative;
  line-height: 1.5;
}
.hero__list li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 600;
}

.hero__actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

/* ===== BUTTONS ===== */
.btn {
  padding: 14px 28px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  transition: all 0.2s;
}
.btn--primary {
  background: var(--accent);
  color: white;
}
.btn--primary:hover { background: #6a57df; transform: translateY(-1px); }
.btn--ghost {
  border: 1px solid rgba(0,0,0,0.18);
  color: var(--text);
  background: var(--bg2);
}
.btn--ghost:hover { background: var(--bg3); }

.back-btn {
  padding: 10px 0;
  font-size: 14px;
  color: var(--text-dim);
  margin-bottom: 32px;
  display: inline-block;
  transition: color 0.2s;
  cursor: pointer;
}
.back-btn:hover { color: var(--text); }

/* ===== SECTIONS ===== */
.section-title {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 8px;
}
.section-sub {
  color: var(--text-dim);
  margin-bottom: 40px;
}
.page-title {
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -1px;
  margin: 48px 0 8px;
}
.page-sub {
  color: var(--text-dim);
  margin-bottom: 40px;
}

.scales-section {
  padding: 80px 24px;
}

.scales-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.scale-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}
.scale-card__letter {
  font-family: var(--mono);
  font-size: 40px;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 12px;
}
.scale-card__name {
  font-weight: 600;
  font-size: 16px;
  margin-bottom: 8px;
}
.scale-card__desc {
  font-size: 14px;
  line-height: 1.6;
}

/* ===== CLUSTERS PREVIEW ===== */
.clusters-preview {
  padding: 0 24px 80px;
}

.clusters-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.cluster-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  background: var(--bg2);
}
.cluster-chip:hover {
  border-color: rgba(255,255,255,0.2);
  transform: translateY(-2px);
}

/* ===== QUIZ ===== */
.quiz {
  max-width: 680px;
  margin: 0 auto;
}
.quiz__step { display: none; }
.quiz__step.active { display: block; }

.quiz__question {
  font-size: 22px;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 32px;
  display: flex;
  align-items: baseline;
  gap: 12px;
}
.quiz__letter {
  font-family: var(--mono);
  font-size: 40px;
  font-weight: 700;
  line-height: 1;
  flex-shrink: 0;
}

.quiz__options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.quiz__opt {
  padding: 20px 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg2);
  text-align: left;
  font-size: 15px;
  line-height: 1.5;
  color: var(--text-dim);
  transition: all 0.2s;
}
.quiz__opt strong { display: block; margin-bottom: 4px; color: var(--text); }
.quiz__opt:hover {
  border-color: var(--accent);
  background: var(--bg3);
  color: var(--text);
  transform: translateX(4px);
}

.quiz__progress {
  max-width: 680px;
  margin: 32px auto 0;
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}
.quiz__bar {
  height: 100%;
  background: var(--accent);
  transition: width 0.4s ease;
  width: 0%;
}

.quiz__result { margin-top: 16px; }
.quiz__result.hidden { display: none; }

/* ===== RESULT CARD ===== */
.result-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px;
  text-align: center;
}
.result-card__code {
  font-family: var(--mono);
  font-size: 48px;
  font-weight: 700;
  margin-bottom: 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: transparent;
}
.result-card__name {
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 20px;
}
.result-card__desc {
  font-size: 15px;
  line-height: 1.7;
  max-width: 520px;
  margin: 0 auto 32px;
}
.result-card__complexity {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 32px;
}
.result-clusters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 32px;
}
.result-cluster-tag {
  padding: 6px 14px;
  border-radius: 100px;
  font-size: 13px;
  font-weight: 500;
  color: white;
}
.result-card__actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ===== TYPES GRID ===== */
.types-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 32px;
}
.filter-btn {
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  font-family: var(--mono);
  color: var(--text-dim);
  transition: all 0.2s;
}
.filter-btn:hover, .filter-btn.active {
  background: var(--bg3);
  color: var(--text);
  border-color: rgba(255,255,255,0.2);
}

.types-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.type-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
}
.type-card:hover {
  border-color: rgba(255,255,255,0.2);
  transform: translateY(-3px);
  background: var(--bg3);
}
.type-card__code {
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 6px;
}
.type-card__name {
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 12px;
}
.type-card__complexity {
  display: flex;
  gap: 3px;
}
.complexity-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--border);
}
.complexity-dot.filled {
  background: var(--accent);
}

/* ===== TYPE DETAIL ===== */
.type-detail__header {
  display: flex;
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 48px;
  flex-wrap: wrap;
}
.type-detail__code {
  font-family: var(--mono);
  font-size: 64px;
  font-weight: 700;
  line-height: 1;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: transparent;
}
.type-detail__name {
  font-size: 28px;
  font-weight: 600;
  margin-top: 8px;
  margin-bottom: 12px;
}
.type-detail__meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.trait-badge {
  padding: 5px 12px;
  border-radius: 100px;
  font-size: 13px;
  font-family: var(--mono);
  font-weight: 600;
}
.type-detail__desc {
  font-size: 17px;
  line-height: 1.8;
  color: var(--text-dim);
  max-width: 720px;
  margin-bottom: 48px;
}

.type-detail__tags-row {
  display: flex;
  flex-wrap: wrap;
  gap: 32px;
  margin: 0 0 40px;
}
.type-tags-group {}
.type-tags-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  margin-bottom: 10px;
}
.type-tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.gives-tag {
  display: inline-block;
  padding: 5px 12px;
  border-radius: 100px;
  font-size: 13px;
  font-weight: 500;
  background: rgba(91,78,204,0.1);
  color: var(--accent);
}
.needs-tag {
  display: inline-block;
  padding: 5px 12px;
  border-radius: 100px;
  font-size: 13px;
  font-weight: 500;
  background: rgba(96,96,122,0.1);
  color: var(--text-dim);
}

/* ===== ARTICLE SECTIONS ===== */
.type-article {
  margin: 0 0 40px;
}
.article-section {
  padding: 28px 0;
  border-bottom: 1px solid var(--border);
}
.article-section:first-child {
  border-top: 1px solid var(--border);
}
.article-section__label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 12px;
}
.article-section__text {
  font-size: 16px;
  line-height: 1.75;
  color: var(--text);
  max-width: 700px;
}
.article-section--positive .article-section__label { color: #3D8A76; }
.article-section--challenge .article-section__label { color: #C26860; }
.article-section--person .article-section__label { color: #5B4ECC; }
.article-section--lifestyle .article-section__label { color: #4A72A0; }
.article-section--skills .article-section__label { color: #C8663A; }
.article-section--howto .article-section__label { color: #2E8B6A; }
.article-section--psych .article-section__label { color: #8B7EC8; }
.article-section--psych .article-section__text { color: var(--text-dim); font-size: 15px; }

.type-detail__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 48px;
}
@media (max-width: 640px) {
  .type-detail__grid { grid-template-columns: 1fr; }
  .type-detail__header { flex-direction: column; }
}

.detail-block {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}
.detail-block h3 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-dim);
  margin-bottom: 14px;
  font-weight: 600;
}
.detail-block ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.detail-block li {
  font-size: 14px;
  color: var(--text-dim);
  padding-left: 18px;
  position: relative;
  line-height: 1.5;
}
.detail-block li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--accent);
}
.detail-block__text {
  font-size: 14px;
  color: var(--text-dim);
  line-height: 1.7;
}

/* colour-coded block variants */
.detail-block--positive { border-top: 3px solid #3D8A76; }
.detail-block--positive li::before { color: #3D8A76; }
.detail-block--challenge { border-top: 3px solid #C26860; }
.detail-block--challenge li::before { color: #C26860; }
.detail-block--person { border-top: 3px solid #5B4ECC; }
.detail-block--person li::before { color: #5B4ECC; }
.detail-block--lifestyle { border-top: 3px solid #4A72A0; }
.detail-block--lifestyle li::before { color: #4A72A0; }
.detail-block--skills { border-top: 3px solid #C8663A; }
.detail-block--skills li::before { color: #C8663A; }
.detail-block--psych { border-top: 3px solid #8B7EC8; }

.type-detail__clusters {
  margin-bottom: 48px;
}
.type-detail__clusters h2 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 16px;
}
.type-clusters-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* ===== CLUSTERS LIST ===== */
.clusters-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.cluster-row {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 24px;
}
.cluster-row:hover {
  border-color: rgba(255,255,255,0.2);
  transform: translateX(4px);
}
.cluster-row__emoji {
  font-size: 36px;
  flex-shrink: 0;
}
.cluster-row__body { flex: 1; }
.cluster-row__name {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 4px;
}
.cluster-row__tagline {
  font-size: 14px;
  color: var(--text-dim);
  margin-bottom: 8px;
}
.cluster-row__count {
  font-size: 13px;
  color: var(--text-dim);
}
.cluster-row__arrow {
  color: var(--text-dim);
  font-size: 20px;
}

/* ===== CLUSTER DETAIL ===== */
.cluster-detail__header {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 32px;
}
.cluster-detail__emoji { font-size: 56px; }
.cluster-detail__name {
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -1px;
}
.cluster-detail__tagline {
  font-size: 16px;
  color: var(--text-dim);
  margin-top: 4px;
}

.cluster-chat-link {
  font-size: 13px;
  font-weight: 500;
  color: #2AABEE;
  text-decoration: none;
  white-space: nowrap;
}
.cluster-chat-link:hover { text-decoration: underline; }

.cluster-chat-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 100px;
  background: #2AABEE;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  margin-bottom: 28px;
  transition: opacity 0.15s;
}
.cluster-chat-btn:hover { opacity: 0.85; }

.cluster-detail__desc {
  font-size: 16px;
  line-height: 1.8;
  color: var(--text-dim);
  max-width: 720px;
  margin-bottom: 40px;
}

.cluster-detail__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 40px;
}
@media (max-width: 640px) {
  .cluster-detail__grid { grid-template-columns: 1fr; }
  .cluster-detail__header { flex-direction: column; align-items: flex-start; }
}

.cluster-types-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
  margin-top: 16px;
}
.cluster-types-grid h2 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 16px;
  grid-column: 1 / -1;
}

/* ===== ABOUT ===== */
.about__block {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  margin-bottom: 20px;
}
.about__block h2 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 16px;
}
.about__block p { margin-bottom: 12px; }
.about__block p:last-child { margin-bottom: 0; }

.about__scales { display: flex; flex-direction: column; gap: 20px; margin-top: 8px; }
.about__scale {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}
.about__scale code {
  font-family: var(--mono);
  font-size: 28px;
  font-weight: 700;
  color: var(--accent);
  width: 40px;
  flex-shrink: 0;
}
.about__scale p { margin-top: 4px; font-size: 14px; }
.about__scale strong { display: block; }

.about__examples {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}
.about__examples div { font-size: 14px; color: var(--text-dim); }
.about__examples code {
  font-family: var(--mono);
  color: var(--accent);
  font-size: 15px;
  margin-right: 8px;
}

/* ===== FOOTER ===== */
.footer {
  border-top: 1px solid var(--border);
  padding: 32px 0;
  text-align: center;
}
.footer p { font-size: 14px; }

/* ===== UTILITIES ===== */
.hidden { display: none !important; }
