:root {
  --bg: #ffffff;
  --surface: #f8fafc;
  --surface-alt: #f1f5f9;
  --text: #0f172a;
  --text-muted: #475569;
  --line: #e2e8f0;
  --line-strong: #cbd5e1;
  --accent: #0f172a;
  --accent-soft: #f8fafc;
  --primary: #2f6b53;
  --primary-soft: #eef5f1;
  --radius: 12px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html {
  background: var(--bg);
}
body {
  font-family: var(--font);
  color: var(--text);
  background: transparent;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.6;
  position: relative;
  overflow-x: hidden;
}

body::before,
body::after {
  content: "";
  position: fixed;
  z-index: -1;
  border-radius: 50%;
  filter: blur(120px);
  pointer-events: none;
  opacity: 0.7;
}

body::before {
  top: -10vw;
  left: -10vw;
  width: 50vw;
  height: 50vw;
  max-width: 600px;
  max-height: 600px;
  background: rgba(47, 107, 83, 0.25);
}

/*body::after {*/
/*  bottom: -10vw;*/
/*  right: -10vw;*/
/*  width: 60vw;*/
/*  height: 60vw;*/
/*  max-width: 700px;*/
/*  max-height: 700px;*/
/*  background: rgba(59, 130, 246, 0.15);*/
/*}*/

h1, h2, h3, h4, p { margin: 0; }
button, input { font: inherit; }
button {
  border: 0;
  cursor: pointer;
  transition: all 0.2s ease;
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.4;
}

.page {
  max-width: 1040px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}

.top-brand {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  opacity: 0.6;
  z-index: 100;
}

/* PANELS & SEPARATORS */
.panel {
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}
.panel:last-child {
  border-bottom: none;
}

@media (max-width: 768px) {
  .panel {
    padding: 20px 0;
  }
}

/* HERO SECTION */
.hero {
  display: flex;
  align-items: center;
  gap: 60px;
  text-align: left;
}
@media (max-width: 768px) {
  .hero {
    flex-direction: column;
    text-align: center;
    gap: 16px;
  }
}

.hero-copy {
  flex: 1;
}

.eyebrow, .pill, .tag {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: 9999px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.05em;
}

.eyebrow {
  background: rgba(47, 107, 83, 0.08);
  color: var(--primary);
  border: 1px solid rgba(47, 107, 83, 0.12);
  margin-bottom: 24px;
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0.08em;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(47, 107, 83, 0.03);
}

.hero h1 {
  font-size: clamp(42px, 6vw, 68px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 20px;
  color: var(--accent);
}

.hero p {
  font-size: clamp(16px, 2vw, 18px);
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 40px;
}

.hero-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
@media (max-width: 768px) {
  .hero-actions {
    justify-content: center;
  }
}

/* FIXED LOGIC BUG: hide jump button initially */
#jumpToolBtn {
  display: none;
}

.hero-visual {
  flex: 0.8;
  display: flex;
  justify-content: center;
}
.hero-visual img {
  width: 100%;
  max-width: 400px;
  height: auto;
}

@media (max-width: 768px) {
  .hero-visual {
    order: -1;
  }
  .hero-visual img {
    max-width: 240px;
  }
}

/* BUTTONS */
.btn-primary, .btn-secondary, .btn-ghost {
  padding: 14px 32px;
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 12px rgba(47, 107, 83, 0.25);
}
.btn-primary:hover:not(:disabled) {
  background: #22513f;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(47, 107, 83, 0.3);
}

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line-strong);
}
.btn-secondary:hover:not(:disabled) {
  border-color: var(--text);
  background: var(--surface-alt);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
}
.btn-ghost:hover:not(:disabled) {
  color: var(--text);
  background: var(--surface);
}

/* VIEWS & TOOL HEADER */
.view { display: none; }
.view.active { display: block; }
.tool-shell.result-mode .tool-head { display: none; }

.tool-head {
  margin-bottom: 28px;
}
.tool-intro {
  max-width: 720px;
}
.tool-intro h2 {
  font-size: clamp(24px, 3.5vw, 32px);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}
.tool-intro p {
  font-size: 16px;
  color: var(--text-muted);
  line-height: 1.7;
}

/* QUIZ VIEW */
.progress-card {
  margin-bottom: 40px;
  padding: 24px;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--line);
}

.progress-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.progress-top .pill {
  font-size: 14px;
  color: var(--text-muted);
  background: transparent;
  padding: 0;
}

.progress-track {
  height: 8px;
  background: var(--line);
  border-radius: 9999px;
  overflow: hidden;
}
.progress-track > span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--primary);
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 16px;
}
.progress-foot .hint {
  font-size: 14px;
  color: var(--text-muted);
}
.progress-foot .tag {
  background: #fff;
  border: 1px solid var(--line);
  color: var(--text-muted);
}

.question-card {
  margin-bottom: 60px;
}

.question-meta {
  margin-bottom: 24px;
  display: flex;
  gap: 12px;
}
.question-meta .pill {
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 16px;
  padding: 8px 16px;
}
.question-meta .tag {
  background: var(--surface);
  color: var(--text-muted);
  border: 1px solid var(--line);
  font-size: 16px;
  padding: 8px 16px;
}

.question-text {
  font-size: clamp(20px, 2.5vw, 26px);
  font-weight: 700;
  line-height: 1.5;
  margin-bottom: 40px;
}

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

.option {
  display: flex;
  align-items: center;
  padding: 20px;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s ease;
  background: #fff;
}
.option:hover {
  border-color: var(--line-strong);
  background: var(--surface);
  transform: translateY(-1px);
}
.option.selected {
  border-color: var(--primary);
  background: var(--primary-soft);
  transform: translateY(0);
}
.option input {
  display: none;
}
.option-code {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--surface-alt);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 15px;
  margin-right: 16px;
  flex-shrink: 0;
  transition: all 0.2s ease;
}
.option.selected .option-code {
  background: var(--primary);
  color: #fff;
}
.option-content {
  font-size: 18px;
  line-height: 1.5;
  color: var(--text);
  font-weight: 500;
}

.question-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 40px;
  padding-top: 32px;
  border-top: 1px solid var(--line);
}
.action-group {
  display: flex;
  gap: 16px;
}

/* RESULTS VIEW */
.result-grid {
  display: flex;
  flex-direction: column;
  gap: 48px;
}

.result-top {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 48px;
  align-items: stretch;
}
@media (max-width: 900px) {
  .result-top { grid-template-columns: 1fr; }
}

.poster-box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.poster-box img {
  width: 100%;
  border-radius: 12px;
}
.poster-box.no-image { display: none; }
.poster-caption {
  margin-top: 16px;
  font-size: 15px;
  color: var(--text-muted);
  text-align: center;
  font-weight: 500;
}

/* Strong dark card for main result */
.result-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 20px;
  background: var(--accent);
  color: #fff;
  border-radius: 24px;
  box-shadow: 0 20px 40px -10px rgba(15, 23, 42, 0.2);
}
.result-card .eyebrow {
  margin-bottom: 20px;
  background: rgba(255,255,255,0.15);
  color: #fff;
}
.result-card .type-name {
  font-size: clamp(36px, 5vw, 56px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 24px;
}
.result-card .match {
  background: var(--primary);
  color: #fff;
  padding: 8px 16px;
  border-radius: 9999px;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 20px;
}
.result-card .type-sub {
  font-size: 16px;
  color: rgba(255,255,255,0.7);
  margin-bottom: 24px;
}
.result-card .type-desc {
  font-size: 18px;
  line-height: 1.7;
  color: rgba(255,255,255,0.95);
}

.dimension-box h3, .note-box h3 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.dimension-box h3::before, .note-box h3::before {
  content: '';
  display: block;
  width: 6px;
  height: 24px;
  background: var(--primary);
  border-radius: 4px;
}

.dimension-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}
.dimension-item {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.02);
}
.dimension-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.dimension-title {
  font-size: 16px;
  font-weight: 700;
}
.dimension-score {
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
  background: var(--primary-soft);
  padding: 4px 10px;
  border-radius: 6px;
}
.dimension-item p {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-muted);
}

.note-box {
  padding: 32px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
}
.note-box p {
  font-size: 16px;
  color: var(--text-muted);
  line-height: 1.6;
}

.result-actions {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 40px;
  padding-top: 40px;
  border-top: 1px solid var(--line);
}

/* SEO SECTION */
.seo-section {
  padding-top: 20px;
}
.seo-section .result-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
@media (max-width: 900px) {
  .seo-section .result-grid { grid-template-columns: 1fr; }
}
/* Override result-card styles for the SEO section to be light */
.seo-section .result-card {
  align-items: flex-start;
  background: var(--surface);
  color: var(--text);
  padding: 32px;
  border: 1px solid var(--line);
  box-shadow: none;
}
.seo-section .result-card .eyebrow {
  margin-bottom: 20px;
  background: rgba(47, 107, 83, 0.08);
  color: var(--primary);
  border: 1px solid rgba(47, 107, 83, 0.12);
}
.seo-section .result-card h3 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 16px;
}
.seo-section .result-card p {
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-muted);
}

/* EMPTY STATE */
.empty-state {
  text-align: center;
  padding: 60px 24px;
  font-size: 16px;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
}

/* MOBILE ADJUSTMENTS */
@media (max-width: 600px) {
  .question-actions {
    flex-direction: column;
    gap: 16px;
  }
  .question-actions .action-group {
    width: 100%;
  }
  .question-actions .action-group button {
    flex: 1;
  }
  .result-actions {
    flex-direction: column;
  }
  .result-actions button {
    width: 100%;
  }
}
