:root {
  color-scheme: light dark;
  --bg: #10131f;
  --panel: #161a2b;
  --text: #f5f7ff;
  --muted: #a7b2d9;
  --accent: #5f7dff;
  --accent-strong: #8b5bff;
  --danger: #f38ba0;
  --success: #5fe0a1;
  --border: rgba(255, 255, 255, 0.08);
  --radius: 16px;
  --shadow: 0 18px 45px rgba(11, 9, 36, 0.55);
  --agree-strong: rgba(15, 140, 79, 0.5);
  --agree-soft: rgba(38, 185, 109, 0.4);
  --disagree-strong: rgba(197, 55, 82, 0.55);
  --disagree-soft: rgba(224, 93, 93, 0.4);
  --neutral-pill: rgba(255, 255, 255, 0.05);
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  background: radial-gradient(circle at top left, #1d2140, #0b0e19);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
}

main {
  width: min(1100px, 95vw);
  margin: 0 auto 4rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.site-header {
  padding: 4rem 1.5rem 2rem;
  display: flex;
  justify-content: center;
}

.header-inner {
  width: min(1100px, 95vw);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
}

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  text-align: center;
}

.hero-insignia {
  width: 88px;
  height: 88px;
  object-fit: contain;
  filter: drop-shadow(0 6px 18px rgba(0, 0, 0, 0.35));
}

.hero-top {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  justify-content: center;
}

.site-nav {
  margin-left: auto;
  padding: 0.25rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  gap: 0.25rem;
  display: inline-flex;
  justify-content: flex-end;
}

.header-inner:has(.site-nav[hidden]) .site-nav {
  display: none;
}

@media (max-width: 700px) {
  .site-nav {
    margin-left: 0;
    align-self: center;
    justify-content: center;
  }

  .hero {
    align-items: center;
    gap: 0.5rem;
  }

  .hero-top {
    width: 100%;
  }

  .hero-insignia {
    width: 72px;
    height: 72px;
  }
}

.nav-link {
  text-decoration: none;
  color: var(--muted);
  padding: 0.75rem 1.75rem;
  border-radius: 999px;
  font-weight: 600;
  transition: background 0.2s, color 0.2s;
}

.nav-link.active {
  background: #fff;
  color: #0e1130;
}

.eyebrow {
  color: var(--accent);
  letter-spacing: 0.2em;
  font-size: 0.75rem;
  text-transform: uppercase;
  margin: 0;
}

h1 {
  margin: 0.5rem 0 1rem;
  font-size: clamp(2.5rem, 5vw, 3.5rem);
}

.tagline {
  max-width: 680px;
  margin: 0 auto;
  color: var(--muted);
  font-size: 1rem;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
}

.page {
  position: relative;
}

.page.is-hidden {
  display: none;
}

.page.page-animating {
  animation: fadeSlideIn 0.45s ease;
}

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

.panel-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-end;
  margin-bottom: 2rem;
}

.panel-header h2 {
  margin: 0;
  font-size: 1.8rem;
}

.panel-header p {
  color: var(--muted);
  margin: 0.35rem 0 0;
}

.axis-legend p {
  margin: 0;
  font-size: 0.95rem;
}

.question-stage {
  min-height: 260px;
}

.question-progress {
  margin: 0 0 0.8rem;
  color: var(--muted);
  font-size: 0.9rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.question-card {
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) / 1.5);
  background: rgba(255, 255, 255, 0.02);
}

.question-card h3 {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
}

.back-btn {
  margin-top: 1rem;
  width: 100%;
}

.answers {
  margin-top: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.answers label {
  position: relative;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.9rem;
  text-align: center;
  transition: border-color 0.2s, background 0.2s;
  overflow: hidden;
}

.answers input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.answers label span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0.4rem 0.75rem;
  border-radius: inherit;
  border: 1px solid transparent;
  color: var(--text);
}

.answers label.answer-strongly-agree span {
  background: var(--agree-strong);
  border-color: rgba(53, 221, 136, 0.25);
}

.answers label.answer-agree span {
  background: var(--agree-soft);
  border-color: rgba(72, 255, 165, 0.3);
}

.answers label.answer-slightly-agree span {
  background: rgba(80, 210, 150, 0.2);
  border-color: rgba(80, 210, 150, 0.25);
}

.answers label.answer-disagree span {
  background: var(--disagree-soft);
  border-color: rgba(255, 138, 138, 0.25);
}

.answers label.answer-slightly-disagree span {
  background: rgba(235, 130, 130, 0.2);
  border-color: rgba(235, 130, 130, 0.25);
}

.answers label.answer-strongly-disagree span {
  background: var(--disagree-strong);
  border-color: rgba(255, 110, 142, 0.3);
}

.answers label.answer-neutral span {
  background: var(--neutral-pill);
  border-color: rgba(255, 255, 255, 0.1);
}

.answers input:focus-visible + span {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.answers input:checked + span {
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.7);
}

button {
  border: none;
  cursor: pointer;
  font-size: 1rem;
  border-radius: 999px;
  padding: 0.75rem 1.5rem;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.primary-btn {
  background: linear-gradient(120deg, var(--accent), var(--accent-strong));
  color: #fff;
  box-shadow: 0 10px 30px rgba(95, 125, 255, 0.35);
}

.ghost-btn {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
}

.ghost-btn.analyze-theme {
  border: none;
  color: #2a1500;
  background: linear-gradient(120deg, #ffcc42, #ff7f23);
  position: relative;
  overflow: hidden;
}

.ghost-btn.analyze-theme::after {
  content: "";
  position: absolute;
  top: -30%;
  left: -60%;
  width: 40%;
  height: 160%;
  background: rgba(255, 255, 255, 0.35);
  transform: rotate(20deg);
  filter: blur(10px);
  animation: shimmer 2.5s linear infinite;
}

@keyframes shimmer {
  0% {
    transform: translateX(0) rotate(20deg);
  }
  100% {
    transform: translateX(400%) rotate(20deg);
  }
}

.error-message {
  color: var(--danger);
  min-height: 1.5em;
  margin: 0;
}

.result-panel {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.personal-compass {
  display: flex;
  justify-content: center;
}

.personal-compass canvas {
  width: min(360px, 100%);
  height: auto;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #0d0f1c;
}

.result-panel h3 {
  margin: 0.5rem 0 0;
}

.result-coordinates {
  font-size: 2rem;
  margin: 0.25rem 0 0.5rem;
  font-family: "JetBrains Mono", "SFMono-Regular", Menlo, Consolas, monospace;
}

.share-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.share-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.share-hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.share-form input {
  padding: 0.65rem 0.9rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

.completion-message {
  margin: 0;
  color: var(--muted);
  text-align: center;
}

.share-form-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.compass-wrapper {
  width: 100%;
  overflow-x: auto;
  padding-bottom: 1rem;
  display: flex;
  justify-content: center;
}

.compass-actions {
  display: flex;
  justify-content: flex-start;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
  align-items: center;
}

.pc-filters {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.pc-filters[hidden] {
  display: none !important;
}

.pc-filter.active {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.35);
  color: #fff;
}

#zoom-button {
  display: none;
}

#zoom-button.zoom-active {
  border-color: rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.12);
  color: var(--text);
}

#compass-canvas {
  width: min(850px, 100%);
  height: auto;
  border-radius: calc(var(--radius) / 1.5);
  border: 1px solid var(--border);
  background: #0d0f1c;
}

.personal-compass canvas {
  width: min(420px, 100%);
}

@media (max-width: 640px) {
  .compass-wrapper {
    width: 100vw;
    margin-left: calc(50% - 50vw);
    overflow: hidden;
  }

  #compass-canvas {
    width: 100vw;
    max-width: 100vw;
  }

  #zoom-button {
    display: inline-flex;
  }
}

.leaderboard {
  margin-top: 2rem;
}

.leaderboard ul {
  list-style: none;
  padding: 0;
  margin: 1rem 0 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 0.75rem;
}

.leaderboard li {
  padding: 0.85rem 1rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.95rem;
}

.axis-explainer {
  margin-top: 1.5rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}

.axis-explainer div {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.75rem 1rem;
}

.axis-explainer strong {
  display: block;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.axis-explainer p {
  margin: 0;
  color: var(--text);
  font-size: 0.95rem;
}

.site-footer {
  text-align: center;
  padding: 1rem;
  color: var(--muted);
  font-size: 0.9rem;
}

@media (max-width: 640px) {
  .panel {
    padding: 1.25rem;
  }

  .answers label span {
    justify-content: flex-start;
    text-align: left;
    padding-left: 1rem;
  }
  
  .submissions li {
    flex-direction: column;
    align-items: flex-start;
    border-radius: 12px;
  }
}
