/* ═══ Reset & Base ═══ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #1a1a19;
  --surface: #252523;
  --surface-hover: #302f2d;
  --surface-selected: #3d2e24;
  --border: #3a3936;
  --border-accent: #d97757;
  --text: #faf9f5;
  --text-muted: #b0aea5;
  --text-dim: #7a786f;
  --accent: #d97757;
  --accent-glow: rgba(217, 119, 87, 0.15);
  --green: #788c5d;
  --red: #c45a4f;
  --blue: #6a9bcc;
  --amber: #d97757;
  --purple: #6a9bcc;
  --radius: 12px;
  --max-width: 640px;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.6;
}

/* ═══ Screens ═══ */
.screen {
  display: none;
  flex: 1;
}

.screen.active {
  display: flex;
  animation: fadeIn 0.4s ease;
}

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

/* ═══ Landing ═══ */
#landing {
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
}

.landing-content {
  max-width: var(--max-width);
  position: relative;
}

/* ═══ Language toggle ═══ */
.lang-toggle {
  display: flex;
  gap: 0.25rem;
  justify-content: center;
  margin-bottom: 1rem;
}

.lang-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 4px 12px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.lang-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.lang-btn:hover:not(.active) {
  border-color: var(--border-accent);
  color: var(--text);
}

.logo {
  font-size: 5rem;
  margin-bottom: 0.5rem;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

h1 {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 2.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent), #e8956a);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.5rem;
}

.subtitle {
  font-size: 1.25rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.meta {
  font-size: 0.875rem;
  color: var(--text-dim);
  margin-bottom: 2rem;
}

.disclaimer {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-top: 1.5rem;
  font-style: italic;
}

/* ═══ Buttons ═══ */
.btn-primary {
  background: linear-gradient(135deg, var(--accent), #c4603e);
  color: white;
  border: none;
  padding: 14px 40px;
  font-size: 1.1rem;
  font-weight: 600;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.2s ease;
  letter-spacing: 0.02em;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(217, 119, 87, 0.3);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 10px 28px;
  font-size: 0.95rem;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 1.5rem;
}

.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ═══ Progress Bar ═══ */
.progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--surface);
  z-index: 100;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #e8956a);
  transition: width 0.4s ease;
  width: 0%;
}

/* ═══ Quiz ═══ */
#quiz {
  flex-direction: column;
  align-items: center;
  padding: 3rem 1.5rem 2rem;
}

.quiz-container {
  max-width: var(--max-width);
  width: 100%;
  text-align: center;
}

.progress-text {
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-bottom: 0.75rem;
}

.question-text {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 1.35rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  line-height: 1.4;
  min-height: 3.8em;
}

.options-container {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.option-card {
  background: var(--surface);
  border: 2px solid transparent;
  border-radius: var(--radius);
  padding: 16px 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--text);
  text-align: center;
}

.option-card:hover {
  background: var(--surface-hover);
  border-color: var(--border-accent);
  transform: scale(1.02);
}

.option-card.selected {
  background: var(--surface-selected);
  border-color: var(--accent);
  transform: scale(1.02);
}

.option-card.disabled {
  pointer-events: none;
  opacity: 0.5;
}

/* Question transition */
.quiz-container.transitioning .question-text,
.quiz-container.transitioning .options-container {
  opacity: 0;
  transform: translateX(-20px);
  transition: all 0.25s ease;
}

.quiz-container.entering .question-text,
.quiz-container.entering .options-container {
  opacity: 0;
  transform: translateX(20px);
}

/* ═══ Analyzing ═══ */
#analyzing {
  align-items: center;
  justify-content: center;
  text-align: center;
}

.analyzing-content p {
  color: var(--text-muted);
  font-size: 1.1rem;
  margin-top: 1.5rem;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ═══ Result ═══ */
#result {
  flex-direction: column;
  align-items: center;
  padding: 2rem 1.5rem;
}

.result-container {
  max-width: var(--max-width);
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.result-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2rem;
  width: 100%;
  text-align: center;
}

.result-label {
  color: var(--text-dim);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.5rem;
}

.result-emoji {
  font-size: 4rem;
  margin: 0.5rem 0;
}

.result-name {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.result-oneliner {
  font-style: italic;
  color: var(--text-muted);
  font-size: 1.05rem;
  margin-bottom: 1.5rem;
}

/* Detail rows */
.result-details {
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1rem;
}

.detail-row {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}

.detail-icon {
  font-size: 1.3rem;
  flex-shrink: 0;
  margin-top: 2px;
}

.detail-row strong {
  display: block;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 2px;
}

.detail-row:nth-child(1) strong { color: var(--green); }
.detail-row:nth-child(2) strong { color: var(--accent); }
.detail-row:nth-child(3) strong { color: var(--blue); }

.detail-row p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Badges */
.badges-section {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.badges-label {
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-bottom: 0.75rem;
}

.badges-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}

.badge-chip {
  background: rgba(106, 155, 204, 0.15);
  border: 1px solid rgba(106, 155, 204, 0.3);
  color: var(--blue);
  padding: 6px 14px;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 500;
}

/* Runner-up */
.runner-up {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.runner-up p {
  font-size: 0.85rem;
  color: var(--text-dim);
}

/* Why section */
.why-section {
  width: 100%;
  margin-top: 2rem;
}

.why-section h3 {
  font-size: 1rem;
  margin-bottom: 0.75rem;
}

.why-section ul {
  list-style: none;
  padding: 0;
}

.why-section li {
  font-size: 0.85rem;
  color: var(--text-muted);
  padding: 0.35rem 0;
  padding-left: 1.25rem;
  position: relative;
}

.why-section li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: var(--text-dim);
}

.reflection {
  margin-top: 1rem;
  font-size: 0.8rem;
  color: var(--text-dim);
  font-style: italic;
  line-height: 1.5;
}

/* Snippet section */
.snippet-section {
  width: 100%;
  margin-top: 2rem;
}

.snippet-section h3 {
  font-size: 1rem;
  margin-bottom: 0.75rem;
}

.snippet-text {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: pre-wrap;
  word-wrap: break-word;
  line-height: 1.6;
  margin-bottom: 1rem;
  font-family: inherit;
  max-height: 300px;
  overflow-y: auto;
}

/* ═══ Back button ═══ */
.btn-back {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 0.85rem;
  padding: 0.5rem 0;
  margin-top: 1rem;
  transition: color 0.2s ease;
}

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

/* ═══ Snippet actions ═══ */
.snippet-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.snippet-actions .btn-primary {
  flex: 1;
  min-width: 140px;
  padding: 12px 24px;
  font-size: 0.95rem;
}

.btn-linkedin {
  background: #0a66c2;
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: 12px 24px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease;
  flex: 1;
  min-width: 140px;
}

.btn-linkedin:hover {
  background: #004182;
}

/* ═══ Footer ═══ */
.footer {
  text-align: center;
  padding: 1.5rem;
  font-size: 0.75rem;
  color: var(--text-dim);
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  align-items: center;
}

.footer a {
  color: var(--text-muted);
  text-decoration: none;
}

.footer a:hover {
  color: var(--accent);
}

/* ═══ Responsive ═══ */
@media (max-width: 480px) {
  h1 {
    font-size: 2rem;
  }

  .question-text {
    font-size: 1.15rem;
  }

  .result-card {
    padding: 1.5rem;
  }

  .result-name {
    font-size: 1.4rem;
  }

  .option-card {
    padding: 14px 16px;
  }
}
