:root {
  --bg: #080b16;
  --panel: rgba(18, 23, 43, 0.88);
  --panel-strong: #141a31;
  --text: #f4f6ff;
  --muted: #aab2ce;
  --line: rgba(255, 255, 255, 0.1);
  --accent: #9d7cff;
  --accent-2: #55d8ff;
  --success: #74e3b5;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top, #151d3d 0, transparent 42%),
    linear-gradient(160deg, #070912 0%, #0b1021 48%, #070912 100%);
  overflow-x: hidden;
}

button { font: inherit; }

.ambient {
  position: fixed;
  width: 360px;
  height: 360px;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.18;
  pointer-events: none;
}
.ambient-one { background: #7a5cff; top: -130px; left: -80px; }
.ambient-two { background: #2fcdf1; bottom: -160px; right: -80px; }

.app-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 40px 0 60px;
  position: relative;
  z-index: 1;
}

.screen { display: none; }
.screen.active { display: block; animation: screenIn 0.45s ease both; }

.hero-screen {
  min-height: calc(100vh - 100px);
  display: none;
  place-content: center;
  text-align: center;
  max-width: 900px;
  margin: 0 auto;
}
.hero-screen.active { display: grid; }

.brand-mark {
  width: 66px;
  height: 66px;
  margin: 0 auto 18px;
  display: grid;
  place-items: center;
  border-radius: 22px;
  font-size: 30px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 16px 40px rgba(111, 93, 255, 0.35);
}

.eyebrow {
  margin: 0 0 12px;
  color: #c4b8ff;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

h1, h2, p { margin-top: 0; }
.hero-screen h1 {
  margin-bottom: 20px;
  font-size: clamp(2.5rem, 6vw, 5.1rem);
  line-height: 0.98;
  letter-spacing: -0.055em;
}
.hero-copy {
  max-width: 720px;
  margin: 0 auto 34px;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.2rem);
  line-height: 1.7;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 30px;
}
.feature-grid article {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.035);
  backdrop-filter: blur(12px);
}
.feature-grid span { display: block; font-size: 1.8rem; font-weight: 900; }
.feature-grid strong { display: block; margin: 4px 0; }
.feature-grid small { color: var(--muted); }

.primary-button, .secondary-button, .text-button, .answer-button {
  border: 0;
  cursor: pointer;
  transition: transform 0.2s ease, opacity 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}
.primary-button {
  padding: 14px 23px;
  border-radius: 14px;
  color: white;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent), #6952e7);
  box-shadow: 0 12px 30px rgba(113, 83, 242, 0.3);
}
.secondary-button {
  padding: 13px 21px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--text);
  font-weight: 750;
  background: rgba(255, 255, 255, 0.055);
}
.text-button { color: var(--muted); background: transparent; }
button:hover:not(:disabled) { transform: translateY(-2px); }
button:disabled { opacity: 0.38; cursor: not-allowed; }
.disclaimer { margin: 18px 0 0; color: #7f89aa; font-size: 0.8rem; }

.quiz-screen { max-width: 850px; margin: 0 auto; }
.quiz-topbar { display: flex; justify-content: space-between; margin-bottom: 14px; color: var(--muted); font-size: 0.9rem; }
.progress-track { height: 8px; margin-bottom: 24px; overflow: hidden; border-radius: 99px; background: rgba(255,255,255,0.08); }
.progress-bar { height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width 0.35s ease; }
.question-card {
  min-height: 510px;
  padding: clamp(26px, 5vw, 52px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 30px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}
.question-card h2 { margin-bottom: 34px; font-size: clamp(1.6rem, 4vw, 2.45rem); line-height: 1.2; letter-spacing: -0.035em; }
.answer-scale { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.answer-button {
  min-height: 92px;
  padding: 14px 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
  color: var(--muted);
  background: rgba(255,255,255,0.035);
}
.answer-button:hover { border-color: rgba(157,124,255,0.7); color: white; }
.answer-button.selected {
  color: white;
  border-color: var(--accent);
  background: rgba(157,124,255,0.2);
  box-shadow: inset 0 0 0 1px rgba(157,124,255,0.25);
}
.quiz-nav { display: flex; justify-content: space-between; margin-top: 30px; }

.result-hero {
  display: grid;
  grid-template-columns: minmax(280px, 0.8fr) 1.2fr;
  gap: 42px;
  align-items: center;
  margin-bottom: 28px;
  padding: 36px;
  border: 1px solid var(--line);
  border-radius: 32px;
  background: linear-gradient(145deg, rgba(26, 32, 59, 0.94), rgba(14, 18, 35, 0.94));
  box-shadow: var(--shadow);
}

.avatar-stage {
  min-height: 390px;
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 26px;
  background:
    radial-gradient(circle at 50% 32%, color-mix(in srgb, var(--avatar-accent, #9d7cff) 35%, transparent), transparent 35%),
    linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.01));
}
.avatar-glow {
  position: absolute;
  width: 250px;
  height: 250px;
  border-radius: 50%;
  background: var(--avatar-accent, #9d7cff);
  filter: blur(70px);
  opacity: 0.26;
}
.avatar-character {
  width: min(285px, 78%);
  position: relative;
  z-index: 2;
  transform-origin: 50% 80%;
  filter: drop-shadow(0 22px 30px rgba(0,0,0,0.4));
}
.avatar-character svg { display: block; width: 100%; height: auto; }
.avatar-shadow {
  position: absolute;
  z-index: 1;
  bottom: 36px;
  width: 190px;
  height: 30px;
  border-radius: 50%;
  background: rgba(0,0,0,0.46);
  filter: blur(8px);
  animation: shadowBreath 4.2s ease-in-out infinite;
}

/* Subtle breathing: tiny vertical lift and scale, intentionally restrained. */
.breathing { animation: characterBreath 4.2s ease-in-out infinite; }
@keyframes characterBreath {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-4px) scale(1.012, 1.018); }
}
@keyframes shadowBreath {
  0%, 100% { transform: scaleX(1); opacity: 0.46; }
  50% { transform: scaleX(0.94); opacity: 0.38; }
}

.type-line { display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; }
.type-line h1 { margin-bottom: 8px; font-size: clamp(3.3rem, 8vw, 6.5rem); line-height: 0.9; letter-spacing: -0.07em; }
.type-line span { color: var(--avatar-accent, #9d7cff); font-size: 1.25rem; font-weight: 850; }
.result-tagline { max-width: 590px; color: var(--muted); font-size: 1.13rem; line-height: 1.65; }
.trait-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.trait-chips span { padding: 8px 11px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,0.04); font-size: 0.82rem; font-weight: 700; }

.result-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.result-card { padding: 26px; border: 1px solid var(--line); border-radius: 22px; background: var(--panel); }
.result-card.wide { grid-column: 1 / -1; }
.result-card h2 { margin-bottom: 14px; font-size: 1.08rem; }
.result-card p, .result-card li, .result-card dd { color: var(--muted); line-height: 1.65; }
.result-card ul { margin: 0; padding-left: 20px; }
.result-card li + li { margin-top: 8px; }
dl { margin: 0; }
dl div + div { margin-top: 14px; }
dt { color: #7f89aa; font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; }
dd { margin: 3px 0 0; }

.dimension-row + .dimension-row { margin-top: 16px; }
.dimension-labels { display: flex; justify-content: space-between; margin-bottom: 6px; font-size: 0.78rem; font-weight: 800; }
.dimension-track { height: 10px; position: relative; border-radius: 999px; background: rgba(255,255,255,0.08); overflow: hidden; }
.dimension-fill { height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent-2), var(--accent)); }
.result-actions { display: flex; justify-content: center; gap: 12px; margin-top: 28px; }

@keyframes screenIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
}

@media (max-width: 760px) {
  .app-shell { width: min(100% - 20px, 1120px); padding-top: 20px; }
  .feature-grid, .result-grid, .result-hero { grid-template-columns: 1fr; }
  .result-card.wide { grid-column: auto; }
  .result-hero { padding: 20px; gap: 22px; }
  .avatar-stage { min-height: 310px; }
  .answer-scale { grid-template-columns: 1fr; }
  .answer-button { min-height: 58px; text-align: left; }
  .question-card { min-height: auto; }
  .type-line h1 { font-size: 4rem; }
}
