/* ==========================================================================
   Which City Fits You? — Styles
   ========================================================================== */

:root {
  --bg: #0b0d14;
  --bg-soft: #12141f;
  --surface: rgba(255, 255, 255, 0.055);
  --surface-solid: #171a26;
  --border: rgba(255, 255, 255, 0.09);
  --text: #f3f4f8;
  --text-dim: #a6abbd;
  --text-faint: #6c7186;
  --accent: #7c9bff;
  --accent-2: #b98bff;
  --accent-3: #4fd8c4;
  --gradient: linear-gradient(120deg, #7c9bff 0%, #b98bff 55%, #4fd8c4 100%);
  --danger: #ff6b6b;
  --radius-lg: 26px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --shadow-soft: 0 20px 60px rgba(0, 0, 0, 0.35);
  --shadow-btn: 0 10px 30px rgba(124, 155, 255, 0.35);
  --maxw: 640px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3 {
  font-family: "Manrope", "Inter", sans-serif;
  margin: 0;
}

p { margin: 0; }

button { font-family: inherit; }

/* ---------------------------- background decor --------------------------- */

#bg-decor {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.35;
  animation: drift 18s ease-in-out infinite alternate;
}

.blob-1 {
  width: 480px; height: 480px;
  background: #5b7dff;
  top: -140px; left: -120px;
}

.blob-2 {
  width: 420px; height: 420px;
  background: #b98bff;
  bottom: -160px; right: -100px;
  animation-delay: -6s;
}

.blob-3 {
  width: 360px; height: 360px;
  background: #4fd8c4;
  top: 40%; left: 60%;
  animation-delay: -12s;
  opacity: 0.22;
}

@keyframes drift {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(40px, -30px) scale(1.08); }
}

/* --------------------------------- layout -------------------------------- */

#app {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.screen {
  display: none;
  min-height: 100vh;
  width: 100%;
  padding: 0 20px;
}

.screen.active {
  display: flex;
  flex-direction: column;
  animation: screenIn 0.5s ease both;
}

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

/* -------------------------------- landing -------------------------------- */

#screen-landing {
  align-items: center;
  justify-content: center;
  text-align: center;
  padding-top: 64px;
  padding-bottom: 64px;
}

.landing-wrap {
  max-width: 560px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
}

.brand-tag {
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--text-dim);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 8px 16px;
  border-radius: 999px;
}

.hero-title {
  font-size: clamp(2.1rem, 7vw, 3.4rem);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.02em;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.br-desktop { display: none; }

.hero-subtitle {
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--text-dim);
  max-width: 480px;
}

.btn {
  border: none;
  cursor: pointer;
  border-radius: 999px;
  font-weight: 700;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, opacity 0.18s ease;
}

.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--gradient);
  color: #0b0d14;
  box-shadow: var(--shadow-btn);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 40px rgba(124, 155, 255, 0.45);
}

.btn-hero {
  padding: 17px 34px;
  font-size: 1.02rem;
  letter-spacing: 0.03em;
  margin-top: 6px;
}

.arrow { display: inline-block; transition: transform 0.18s ease; }
.btn-hero:hover .arrow { transform: translateX(4px); }

.hero-meta {
  color: var(--text-faint);
  font-size: 0.9rem;
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
}

.hero-meta .dot { opacity: 0.5; }

.hero-flags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  max-width: 420px;
  font-size: 1.4rem;
  opacity: 0.75;
  margin-top: 8px;
}

/* ---------------------------------- quiz ---------------------------------- */

#screen-quiz {
  align-items: center;
  padding-top: 28px;
  padding-bottom: 40px;
}

.quiz-wrap {
  width: 100%;
  max-width: var(--maxw);
  display: flex;
  flex-direction: column;
  gap: 28px;
  flex: 1;
}

.quiz-topbar {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-icon {
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 1rem;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s ease, opacity 0.15s ease;
}

.btn-icon:hover { background: rgba(255,255,255,0.12); }
.btn-icon:disabled { opacity: 0.3; cursor: default; }

.progress-track {
  flex: 1;
  height: 8px;
  background: var(--surface);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--gradient);
  border-radius: 999px;
  transition: width 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}

.question-counter {
  font-size: 0.82rem;
  color: var(--text-faint);
  white-space: nowrap;
  font-weight: 600;
}

.question-card {
  display: flex;
  flex-direction: column;
  gap: 22px;
  margin-top: 8px;
  animation: questionIn 0.4s ease both;
}

@keyframes questionIn {
  from { opacity: 0; transform: translateX(16px); }
  to { opacity: 1; transform: translateX(0); }
}

.question-text {
  font-size: clamp(1.35rem, 4.4vw, 1.8rem);
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.01em;
}

.options-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.option-btn {
  text-align: left;
  padding: 18px 20px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.option-btn:hover {
  border-color: rgba(124, 155, 255, 0.5);
  background: rgba(124, 155, 255, 0.09);
  transform: translateY(-2px);
}

.option-btn:active { transform: translateY(0) scale(0.99); }

.option-btn.selected {
  border-color: var(--accent);
  background: rgba(124, 155, 255, 0.18);
  box-shadow: 0 0 0 1px var(--accent) inset;
}

/* --------------------------------- loading -------------------------------- */

#screen-loading {
  align-items: center;
  justify-content: center;
  text-align: center;
}

.loading-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 26px;
}

.loading-orb {
  position: relative;
  width: 120px; height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.orb-core {
  font-size: 2.6rem;
  animation: pulse 1.6s ease-in-out infinite;
  z-index: 1;
}

.orb-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2.5px solid transparent;
  border-top-color: var(--accent);
  border-right-color: var(--accent-2);
  animation: spin 1.1s linear infinite;
}

.orb-ring-2 {
  inset: 14px;
  border-top-color: var(--accent-3);
  border-right-color: transparent;
  border-left-color: var(--accent-3);
  animation-duration: 1.6s;
  animation-direction: reverse;
}

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.12); opacity: 0.8; }
}

.loading-text {
  font-size: 1.05rem;
  color: var(--text-dim);
  font-weight: 600;
  transition: opacity 0.25s ease;
}

/* --------------------------------- result --------------------------------- */

#screen-result { align-items: center; padding-top: 32px; padding-bottom: 56px; }

.result-wrap {
  width: 100%;
  max-width: var(--maxw);
  display: flex;
  flex-direction: column;
  gap: 18px;
}

#locked-content {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

#locked-content[hidden] {
  display: none;
}

.result-hero {
  text-align: center;
  padding: 34px 20px 30px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.result-eyebrow {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--text-faint);
  text-transform: uppercase;
}

.result-city-name {
  font-size: clamp(2rem, 8vw, 2.7rem);
  font-weight: 800;
  font-family: "Manrope", sans-serif;
}

.result-match-badge {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 8px 22px;
  border-radius: 999px;
  background: var(--gradient);
  margin-top: 4px;
}

.result-score {
  font-size: 1.5rem;
  font-weight: 800;
  color: #0b0d14;
}

.result-score-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: rgba(11, 13, 20, 0.75);
}

.card {
  padding: 26px 22px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border);
}

.card-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 14px;
}

.why-text {
  color: var(--text-dim);
  line-height: 1.7;
  font-size: 0.98rem;
}

/* paywall */

.paywall-card {
  text-align: center;
  background: linear-gradient(160deg, rgba(124,155,255,0.12), rgba(185,139,255,0.08));
  border-color: rgba(124, 155, 255, 0.3);
}

.paywall-badge {
  display: inline-block;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--border);
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 14px;
}

.paywall-features {
  list-style: none;
  margin: 18px 0 26px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 11px;
  text-align: left;
}

.paywall-features li {
  font-size: 0.94rem;
  color: var(--text-dim);
  line-height: 1.4;
}

.btn-unlock {
  padding: 17px 28px;
  font-size: 1rem;
  width: 100%;
}

.link-btn {
  display: block;
  margin: 14px auto 0;
  background: none;
  border: none;
  color: var(--text-faint);
  font-size: 0.82rem;
  text-decoration: underline;
  cursor: pointer;
  padding: 4px;
}

.link-btn:hover { color: var(--text-dim); }

/* scorecard */

.scorecard-list { display: flex; flex-direction: column; gap: 14px; }

.scorecard-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 12px;
  align-items: center;
}

.scorecard-label { font-size: 0.9rem; color: var(--text-dim); font-weight: 500; }
.scorecard-value { font-size: 0.88rem; font-weight: 700; color: var(--text); }

.bar-track {
  grid-column: 1 / -1;
  height: 8px;
  background: rgba(255,255,255,0.07);
  border-radius: 999px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: var(--gradient);
  transition: width 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}

/* top 10 */

.top10-list { display: flex; flex-direction: column; gap: 10px; }

.top10-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  opacity: 0;
  transform: translateY(10px);
  animation: cardPop 0.5s ease forwards;
}

@keyframes cardPop {
  to { opacity: 1; transform: translateY(0); }
}

.top10-rank {
  width: 30px;
  text-align: center;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-faint);
  flex-shrink: 0;
}

.top10-rank.medal { font-size: 1.3rem; }

.top10-flag { font-size: 1.4rem; flex-shrink: 0; }

.top10-info { flex: 1; min-width: 0; }

.top10-city { font-weight: 700; font-size: 0.98rem; }
.top10-country { font-size: 0.78rem; color: var(--text-faint); }

.top10-bar-track {
  height: 5px;
  background: rgba(255,255,255,0.07);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 6px;
}

.top10-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--gradient);
  width: 0%;
  transition: width 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}

.top10-score {
  font-weight: 800;
  font-size: 0.98rem;
  flex-shrink: 0;
  min-width: 44px;
  text-align: right;
}

/* lifestyle profile */

.persona-name {
  font-size: 1.3rem;
  font-weight: 800;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 8px;
}

.persona-desc {
  color: var(--text-dim);
  line-height: 1.7;
  font-size: 0.96rem;
  margin-bottom: 20px;
}

.traits-list { display: flex; flex-direction: column; gap: 13px; }

.trait-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 10px;
  align-items: center;
}

.trait-label { font-size: 0.88rem; color: var(--text-dim); font-weight: 500; }
.trait-value { font-size: 0.85rem; font-weight: 700; }

/* share */

.share-hint { color: var(--text-dim); font-size: 0.92rem; margin-bottom: 16px; }

.share-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.btn-secondary {
  padding: 13px 20px;
  font-size: 0.92rem;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.06);
  color: var(--text);
}

.btn-secondary:hover { background: rgba(255,255,255,0.12); }

.take-test-link {
  display: inline-block;
  margin-top: 16px;
  color: var(--accent);
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
}

.take-test-link:hover { text-decoration: underline; }

.btn-retake {
  padding: 16px 20px;
  font-size: 1rem;
  align-self: center;
  margin-top: 4px;
}

.disclaimer {
  text-align: center;
  font-size: 0.76rem;
  color: var(--text-faint);
  line-height: 1.6;
  padding: 4px 8px 0;
}

/* reveal animation applied via JS by toggling .in class */
.reveal { opacity: 0; transform: translateY(16px); }
.reveal.in {
  animation: revealIn 0.55s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes revealIn {
  to { opacity: 1; transform: translateY(0); }
}

/* ---------------------------------- toast --------------------------------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%) translateY(20px);
  background: var(--surface-solid);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px 22px;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 600;
  box-shadow: var(--shadow-soft);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 50;
  white-space: nowrap;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* -------------------------------- responsive ------------------------------- */

@media (min-width: 700px) {
  .br-desktop { display: inline; }

  .screen { padding: 0 32px; }

  .card, .result-hero { padding: 34px 36px; }

  .options-list { gap: 14px; }

  .option-btn { padding: 20px 24px; font-size: 1.05rem; }

  .top10-card { padding: 16px 20px; }
}

@media (min-width: 900px) {
  :root { --maxw: 700px; }
}

/* -------------------------------- reduced motion ---------------------------- */

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .blob { animation: none; }
}
