/* ============================================================
   Career Quiz — Linear Design System
   ============================================================ */

/* --- CSS Variables (Linear palette) --- */
:root {
  --primary: #5e6ad2;
  --primary-hover: #828fff;
  --primary-focus: #5e69d1;
  --on-primary: #ffffff;
  --ink: #f7f8f8;
  --ink-muted: #d0d6e0;
  --ink-subtle: #8a8f98;
  --ink-tertiary: #62666d;
  --canvas: #010102;
  --surface-1: #0f1011;
  --surface-2: #141516;
  --surface-3: #18191a;
  --hairline: #23252a;
  --hairline-strong: #34343a;
  --success: #27a644;
  --font-display: 'Inter', 'SF Pro Display', -apple-system, system-ui, sans-serif;
  --font-body: 'Inter', -apple-system, system-ui, sans-serif;
}

/* No light mode per Linear design: "Don't ship a light-mode marketing page" */

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: -0.05px;
  color: var(--ink);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); }
button { cursor: pointer; border: none; font-family: inherit; }
img { max-width: 100%; height: auto; }
kbd {
  background: var(--surface-2);
  border: 1px solid var(--hairline-strong);
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 12px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
}

/* --- Global Header --- */
.global-header {
  background: var(--canvas);
  border-bottom: 1px solid var(--hairline);
  height: 56px;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-left { display: flex; align-items: center; gap: 16px; }
.logo {
  color: var(--primary);
  font-weight: 700;
  font-size: 18px;
  text-decoration: none;
  letter-spacing: -0.4px;
}
.breadcrumb { color: var(--ink-subtle); font-size: 14px; }
.breadcrumb a { color: var(--ink-subtle); }
.breadcrumb a:hover { color: var(--ink); }
.breadcrumb .sep { margin: 0 6px; }
.header-right { display: flex; align-items: center; gap: 16px; }
.back-to-hub {
  color: var(--ink-subtle);
  font-size: 14px;
  font-weight: 500;
}
.back-to-hub:hover { color: var(--ink); }
.theme-toggle {
  background: transparent;
  color: var(--ink-subtle);
  font-size: 18px;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.theme-toggle:hover { color: var(--ink); background: var(--surface-1); }

/* --- Layout: 3-column --- */
.layout {
  display: grid;
  grid-template-columns: 180px 1fr 320px;
  gap: 24px;
  max-width: 1400px;
  margin: 0 auto;
  padding: 32px 24px;
}
.sidebar { position: sticky; top: 80px; align-self: start; }
.main-content { min-width: 0; }

/* --- Stages --- */
.stage { display: none; }
.stage--active { display: block; }

/* --- Hero Section --- */
.hero-section {
  text-align: center;
  padding: 64px 0 48px;
}
.hero-section h1 {
  font-family: var(--font-display);
  font-size: 56px;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -1.8px;
  margin-bottom: 16px;
}
.subtitle {
  font-size: 18px;
  color: var(--ink-muted);
  line-height: 1.5;
  letter-spacing: -0.1px;
  max-width: 560px;
  margin: 0 auto 32px;
}
.social-proof {
  color: var(--ink-tertiary);
  font-size: 14px;
  margin-top: 16px;
}

/* --- Buttons --- */
.btn-primary {
  background: var(--primary);
  color: var(--on-primary);
  font-size: 14px;
  font-weight: 500;
  padding: 12px 32px;
  border-radius: 8px;
  transition: background 0.2s;
}
.btn-primary:hover { background: var(--primary-hover); }
.btn-primary:active { background: var(--primary-focus); }

.btn-secondary {
  background: var(--surface-1);
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  padding: 10px 24px;
  border-radius: 8px;
  border: 1px solid var(--hairline);
  transition: background 0.2s;
}
.btn-secondary:hover { background: var(--surface-2); }

.btn-tertiary {
  background: transparent;
  color: var(--ink-subtle);
  font-size: 14px;
  font-weight: 500;
  padding: 10px 24px;
  border-radius: 8px;
  transition: color 0.2s;
}
.btn-tertiary:hover { color: var(--ink); }

/* --- Features Grid (landing) --- */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 48px;
}
.feature-card {
  background: var(--surface-1);
  border: 1px solid var(--hairline);
  border-radius: 12px;
  padding: 24px;
  text-align: center;
}
.feature-icon { font-size: 32px; display: block; margin-bottom: 12px; }
.feature-card h3 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.2px;
  margin-bottom: 8px;
}
.feature-card p {
  color: var(--ink-muted);
  font-size: 14px;
  line-height: 1.5;
}

/* --- Educational Content --- */
.content-section {
  margin-top: 48px;
  padding-top: 48px;
  border-top: 1px solid var(--hairline);
}
.content-section section { margin-bottom: 40px; }
.content-section h2 {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.6px;
  margin-bottom: 16px;
}
.content-section p {
  color: var(--ink-muted);
  font-size: 16px;
  line-height: 1.6;
  margin-bottom: 12px;
}
.content-section strong { color: var(--ink); }

/* --- FAQ --- */
.faq-section details {
  background: var(--surface-1);
  border: 1px solid var(--hairline);
  border-radius: 8px;
  margin-bottom: 8px;
  overflow: hidden;
}
.faq-section summary {
  padding: 16px 20px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  color: var(--ink);
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.faq-section summary::after { content: '+'; color: var(--ink-subtle); font-size: 18px; }
.faq-section details[open] summary::after { content: '\2212'; }
.faq-answer {
  padding: 0 20px 16px;
}
.faq-answer p {
  color: var(--ink-muted);
  font-size: 14px;
  line-height: 1.6;
}

/* --- Cross-Links --- */
.cross-links {
  padding: 48px 0;
  border-top: 1px solid var(--hairline);
  margin-top: 48px;
}
.cross-links h2 {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.4px;
  margin-bottom: 20px;
}
.cross-links-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.cross-link-card {
  background: var(--surface-1);
  border: 1px solid var(--hairline);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: background 0.2s, border-color 0.2s;
}
.cross-link-card:hover {
  background: var(--surface-2);
  border-color: var(--hairline-strong);
  color: var(--ink);
}
.cross-link-icon { font-size: 24px; }
.cross-link-name {
  font-weight: 600;
  font-size: 15px;
  color: var(--ink);
}
.cross-link-desc {
  font-size: 13px;
  color: var(--ink-subtle);
  line-height: 1.4;
}

/* --- Ad Slots --- */
.ad-slot {
  display: flex;
  justify-content: center;
  align-items: center;
  background: var(--surface-1);
  border-radius: 8px;
  overflow: hidden;
}
.ad-slot--inline { margin: 32px 0; }
.ad-slot--bottom { margin-top: 32px; }

/* --- Global Footer --- */
.global-footer {
  background: var(--canvas);
  border-top: 1px solid var(--hairline);
  padding: 32px;
  text-align: center;
}
.footer-links { margin-bottom: 12px; }
.footer-links a {
  color: var(--ink-subtle);
  font-size: 13px;
  margin: 0 16px;
}
.footer-links a:hover { color: var(--ink); }
.footer-copyright { color: var(--ink-tertiary); font-size: 12px; }

/* ============================================================
   STAGE 2: QUIZ
   ============================================================ */
.quiz-container {
  max-width: 640px;
  margin: 0 auto;
  padding: 48px 24px;
  min-height: calc(100vh - 56px - 100px);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.quiz-progress { margin-bottom: 40px; }
.quiz-progress-bar {
  width: 100%;
  height: 4px;
  background: var(--surface-2);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 12px;
}
.quiz-progress-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 2px;
  transition: width 0.3s ease;
  width: 3.33%;
}
.quiz-progress-text {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-subtle);
  letter-spacing: 0.4px;
}

.quiz-card {
  background: var(--surface-1);
  border: 1px solid var(--hairline);
  border-radius: 12px;
  padding: 40px 32px;
}
.quiz-question {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.4px;
  line-height: 1.35;
  margin-bottom: 32px;
  text-align: center;
}

.likert-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.likert-btn {
  background: var(--surface-2);
  border: 1px solid var(--hairline);
  border-radius: 8px;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--ink-muted);
  font-size: 15px;
  font-weight: 400;
  transition: all 0.15s;
}
.likert-btn:hover {
  background: var(--surface-3);
  border-color: var(--hairline-strong);
  color: var(--ink);
}
.likert-btn--selected {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--on-primary);
}
.likert-btn--selected:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
  color: var(--on-primary);
}
.likert-key {
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-tertiary);
  background: var(--surface-1);
  border-radius: 4px;
  padding: 2px 7px;
}
.likert-btn--selected .likert-key {
  background: rgba(255,255,255,0.2);
  color: var(--on-primary);
}

.quiz-hint {
  text-align: center;
  color: var(--ink-tertiary);
  font-size: 13px;
  margin-top: 24px;
}

/* ============================================================
   STAGE 3: RESULTS
   ============================================================ */
.results-header {
  text-align: center;
  padding: 48px 0 24px;
}
.results-header h2 {
  font-family: var(--font-display);
  font-size: 40px;
  font-weight: 600;
  letter-spacing: -1.0px;
  margin-bottom: 12px;
}
.results-code {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 600;
  color: var(--primary);
  letter-spacing: -0.6px;
}

.chart-wrapper {
  display: flex;
  justify-content: center;
  padding: 16px 0 40px;
}
#radarChart { max-width: 400px; width: 100%; height: auto; }

/* Top Types */
.top-types {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 40px;
}
.type-card {
  background: var(--surface-1);
  border: 1px solid var(--hairline);
  border-radius: 12px;
  padding: 20px;
}
.type-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.type-badge {
  background: var(--primary);
  color: var(--on-primary);
  font-size: 13px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 4px;
}
.type-name {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.2px;
}
.type-score {
  font-size: 13px;
  color: var(--ink-subtle);
  margin-bottom: 8px;
}
.type-desc {
  font-size: 14px;
  color: var(--ink-muted);
  line-height: 1.5;
}

/* Matched Careers */
.matched-careers {
  margin-bottom: 40px;
}
.matched-careers h3 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.4px;
  margin-bottom: 16px;
}
.careers-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}
.career-item {
  background: var(--surface-1);
  border: 1px solid var(--hairline);
  border-radius: 8px;
  padding: 16px;
}
.career-title {
  font-weight: 600;
  font-size: 15px;
  margin-bottom: 4px;
}
.career-type {
  font-size: 12px;
  color: var(--ink-subtle);
}

/* Cluster CTA (KEY FUNNEL) */
.cluster-cta {
  background: var(--surface-1);
  border: 1px solid var(--hairline);
  border-radius: 12px;
  padding: 32px;
  margin-bottom: 32px;
}
.cluster-cta h3 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.4px;
  margin-bottom: 20px;
  text-align: center;
}
.cluster-cta-links {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.cluster-cta-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface-2);
  border: 1px solid var(--hairline);
  border-radius: 8px;
  padding: 16px 20px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 500;
  transition: all 0.2s;
}
.cluster-cta-link:hover {
  background: var(--surface-3);
  border-color: var(--primary);
  color: var(--ink);
}
.cluster-cta-link .cta-arrow {
  color: var(--primary);
  font-size: 18px;
}

/* Results Actions */
.results-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-bottom: 8px;
}
.share-feedback {
  text-align: center;
  font-size: 13px;
  color: var(--success);
  min-height: 20px;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1100px) {
  .layout { grid-template-columns: 1fr 300px; }
  .sidebar--left { display: none; }
}

@media (max-width: 768px) {
  .layout { grid-template-columns: 1fr; padding: 24px 16px; }
  .sidebar--left, .sidebar--right { display: none; }

  .global-header { padding: 0 16px; }
  .breadcrumb { display: none; }

  .hero-section h1 { font-size: 36px; letter-spacing: -1.0px; }
  .subtitle { font-size: 16px; }

  .features-grid { grid-template-columns: 1fr; }

  .cross-links-grid { grid-template-columns: 1fr; }

  .quiz-card { padding: 28px 20px; }
  .quiz-question { font-size: 18px; }

  .likert-group { gap: 8px; }
  .likert-btn { padding: 12px 16px; font-size: 14px; }

  .results-header h2 { font-size: 28px; }
  .results-code { font-size: 22px; }

  .top-types { grid-template-columns: 1fr; }
  .careers-list { grid-template-columns: 1fr 1fr; }

  .cluster-cta { padding: 24px 16px; }
  .cluster-cta-link { font-size: 14px; padding: 14px 16px; }

  .results-actions { flex-direction: column; align-items: center; }
}

@media (max-width: 480px) {
  .hero-section { padding: 40px 0 32px; }
  .hero-section h1 { font-size: 28px; }
  .careers-list { grid-template-columns: 1fr; }
}
