:root {
  --bg: #f5f1ea;
  --bg-soft: #eee8de;
  --surface: #ffffff;
  --surface-soft: #faf7f2;
  --line: #d7d0c6;
  --line-strong: #b7aea1;
  --text: #171614;
  --muted: #676258;
  --accent: #1d1d1a;
  --accent-strong: #11110f;
  --accent-soft: #ece6dc;
  --radius-lg: 24px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --shadow-soft: 0 20px 50px rgba(22, 20, 16, 0.04);
  --shell-max: 1180px;
  --font-display: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  font-family: 'Plus Jakarta Sans', 'Segoe UI', sans-serif;
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0) 24%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-soft) 100%);
}

a {
  color: inherit;
  text-decoration: none;
}

.icon {
  width: 1em;
  height: 1em;
  fill: currentColor;
  flex: 0 0 auto;
}

.site-shell {
  max-width: var(--shell-max);
  margin: 0 auto;
  padding: 28px clamp(20px, 4vw, 48px) 56px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 22px;
  margin-bottom: 52px;
  border-bottom: 1px solid rgba(95, 103, 114, 0.12);
}

.brand {
  font-family: var(--font-display);
  font-size: 1.32rem;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.topbar-context {
  margin: 0;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.75fr) minmax(240px, 0.8fr);
  gap: 40px;
  align-items: start;
  margin-bottom: 48px;
  padding: 0 0 24px;
  border: 0;
  border-bottom: 1px solid rgba(95, 103, 114, 0.12);
  background: transparent;
  box-shadow: none;
}

.hero-copy {
  max-width: 680px;
  width: 100%;
}

.hero-kicker {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1,
h2,
h3,
h4,
h5 {
  margin: 0;
  line-height: 1.2;
}

h1 {
  font-family: var(--font-display);
  font-size: clamp(2.7rem, 5.2vw, 4.9rem);
  max-width: 9ch;
  letter-spacing: -0.06em;
  line-height: 0.92;
}

.hero-subtitle {
  margin: 24px 0 0;
  max-width: 34ch;
  color: var(--muted);
  line-height: 1.82;
  font-size: 1.02rem;
}

.hero-actions {
  margin-top: 30px;
}

.hero-actions .btn {
  min-width: 148px;
}

.hero-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 28px;
}

.hero-metrics span {
  display: inline-flex;
  align-items: center;
  padding-top: 14px;
  border-top: 1px solid rgba(95, 103, 114, 0.14);
  color: var(--muted);
  font-size: 0.8rem;
  min-width: 112px;
}

.hero-panel {
  align-self: stretch;
  width: 100%;
  max-width: 300px;
  justify-self: end;
  padding: 6px 0 0;
  border-radius: 0;
  border: 0;
  border-top: 0;
  background: transparent;
}

.hero-panel-label {
  margin: 0;
  color: var(--muted);
  font-family: var(--font-display);
  font-size: 1.28rem;
  line-height: 1.45;
  letter-spacing: -0.02em;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 3vw, 2.7rem);
  margin-bottom: 10px;
  letter-spacing: -0.04em;
}

.section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.section-header > :first-child {
  max-width: 560px;
  min-width: 0;
}

.section-eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.section-subtitle {
  margin: 0;
  max-width: 42ch;
  color: var(--muted);
  line-height: 1.8;
}

.library-toolbar {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 0;
  padding: 0;
  align-self: flex-start;
  border-radius: 0;
  border: 0;
  min-width: 170px;
  background: transparent;
}

.library-toolbar .library-filter-select {
  width: 100%;
}

.library-filter-label {
  display: inline-flex;
  align-items: center;
  font-size: 0.76rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
}

.library-filter-select {
  -webkit-appearance: none;
  appearance: none;
  border: 1px solid rgba(95, 103, 114, 0.14);
  border-radius: 999px;
  background-color: rgba(255, 255, 255, 0.86);
  color: var(--text);
  font: inherit;
  font-size: 0.91rem;
  line-height: 1.3;
  min-width: 170px;
  padding: 9px 34px 9px 12px;
  cursor: pointer;
  background-image:
    linear-gradient(45deg, transparent 50%, #6b7788 50%),
    linear-gradient(135deg, #6b7788 50%, transparent 50%);
  background-position:
    calc(100% - 16px) calc(50% - 2px),
    calc(100% - 11px) calc(50% - 2px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

.library-filter-select:hover {
  border-color: var(--line-strong);
}

.library-filter-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(46, 95, 144, 0.14);
}

.quiz-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 20px;
  align-items: stretch;
}

.quiz-card {
  display: flex;
  flex-direction: column;
  grid-column: span 4;
  min-height: 100%;
  border: 1px solid rgba(95, 103, 114, 0.12);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.84);
  padding: 20px;
  box-shadow: var(--shadow-soft);
  transition: border-color 0.2s ease, transform 0.2s ease, background-color 0.2s ease;
}

.quiz-card > * {
  width: 100%;
}

.quiz-card:hover {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.96);
  transform: translateY(-2px);
}

.quiz-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.card-category,
.quiz-card-time {
  font-size: 0.78rem;
  color: var(--muted);
}

.card-category {
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--muted);
  font-weight: 500;
}

.quiz-card-time {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.quiz-card-time .icon {
  color: #738195;
}

.quiz-card h3 {
  font-family: var(--font-display);
  font-size: 1.8rem;
  margin-bottom: 12px;
  letter-spacing: -0.04em;
  line-height: 1;
  max-width: 10ch;
}

.quiz-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
  max-width: 28ch;
}

.quiz-card-footer {
  margin-top: auto;
  padding-top: 16px;
}

.quiz-card-footer .btn {
  align-self: flex-start;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 999px;
  border: 1px solid transparent;
  padding: 12px 18px;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.btn .icon {
  width: 0.95em;
  height: 0.95em;
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 500;
}

.btn-primary:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
  transform: translateY(-1px);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.7);
  border-color: rgba(95, 103, 114, 0.16);
  color: var(--text);
}

.btn-ghost:hover {
  background: #edf1f5;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.site-footer {
  margin-top: 56px;
  padding-top: 22px;
  border-top: 1px solid rgba(95, 103, 114, 0.12);
  color: var(--muted);
  font-size: 0.84rem;
}

.home-page .empty-state {
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.78);
}

.empty-state,
.not-found {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 18px;
  background: var(--surface);
  color: var(--muted);
}

.quiz-layout {
  display: block;
  max-width: 1040px;
}

.quiz-main {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow-soft);
}

.quiz-main {
  padding: 24px 26px;
}

.quiz-eyebrow {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.quiz-intro-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.quiz-intro-head > :first-child {
  max-width: 560px;
}

.quiz-intro-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 4.2vw, 3.5rem);
  max-width: 11ch;
  letter-spacing: -0.05em;
  line-height: 0.92;
}

.quiz-intro-meta {
  display: grid;
  gap: 10px;
  min-width: 160px;
  padding-top: 6px;
}

.quiz-intro-meta span {
  display: block;
  padding-top: 10px;
  border-top: 1px solid rgba(95, 103, 114, 0.12);
  color: var(--muted);
  font-size: 0.82rem;
}

.progress-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.progress-label {
  font-size: 0.84rem;
  color: var(--muted);
}

.progress-track {
  width: 100%;
  height: 6px;
  background: #e7e2da;
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 20px;
}

.progress-fill {
  display: block;
  height: 100%;
  background: var(--accent);
}

.question-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3rem);
  margin-bottom: 12px;
  max-width: 12ch;
  letter-spacing: -0.05em;
  line-height: 0.95;
}

.question-helper {
  margin: 0 0 14px;
  color: var(--muted);
  line-height: 1.6;
  max-width: 44ch;
}

.choice-list {
  display: grid;
  gap: 10px;
  max-width: 100%;
}

.choice {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  text-align: left;
  font: inherit;
  color: var(--text);
  padding: 16px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  transition: border-color 0.16s ease, background-color 0.16s ease;
}

.choice strong {
  display: block;
  margin-bottom: 6px;
  font-size: 1rem;
  color: var(--text);
}

.choice span {
  display: block;
  font-size: 0.87rem;
  color: var(--muted);
}

.choice:hover {
  border-color: var(--line-strong);
}

.choice[data-selected='true'] {
  border-color: var(--accent);
  background: #f6f3ee;
}

.not-relevant-row {
  margin-top: 14px;
  display: flex;
  justify-content: flex-start;
}

.not-relevant-btn {
  font-size: 0.84rem;
  color: #5b697a;
  background: #fff;
}

.not-relevant-btn[data-selected='true'] {
  border-color: var(--accent);
  color: var(--accent-strong);
  background: #f6f3ee;
}

.quiz-nav {
  margin-top: 18px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.quiz-nav > * {
  flex: 0 0 auto;
}

.result-page {
  max-width: 1040px;
}

.result-hero-clean {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.result-hero-clean > * {
  min-width: 0;
}

.result-kicker {
  margin: 0 0 8px;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  font-weight: 600;
}

.result-page-title {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 4.2vw, 3.4rem);
  max-width: 14ch;
  letter-spacing: -0.05em;
  line-height: 0.92;
}

.result-page-summary {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.65;
  max-width: 50ch;
}

.result-page-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: flex-start;
}

.result-page-actions .btn {
  flex: 0 0 auto;
}

.result-main-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow-soft);
  padding: 24px;
}

.result-main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 320px);
  gap: 24px;
}

.result-main-copy {
  min-width: 0;
}

.result-note {
  margin: 0;
  color: #425061;
  line-height: 1.62;
  max-width: 48ch;
}

.result-subtitle {
  margin: 14px 0 8px;
  font-size: 0.84rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #556477;
}

.outcome-points {
  margin: 0;
  padding-left: 16px;
  color: #4b5766;
  line-height: 1.48;
}

.outcome-points li + li {
  margin-top: 6px;
}

.result-main-cta {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
  padding: 14px;
  align-self: start;
  width: 100%;
}

.result-meta-inline {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
  color: #4e5967;
  font-size: 0.8rem;
}

.result-meta-inline span {
  display: inline-flex;
  align-items: center;
}

.result-meta-inline span + span::before {
  content: '\2022';
  margin-right: 8px;
  color: #97a3b3;
}

.btn-result-main,
.btn-result-sub {
  min-height: 42px;
}

.btn-result-main {
  width: 100%;
}

.mini-disclosure {
  margin: 10px 0 0;
  font-size: 0.74rem;
  color: #6e7886;
  line-height: 1.35;
}

.result-clean-section {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow-soft);
  padding: 18px;
}

.result-section-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  margin-bottom: 14px;
  letter-spacing: -0.03em;
}

.result-secondary-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.result-secondary-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.72);
  min-height: 100%;
}

.result-secondary-copy {
  width: 100%;
}

.btn-result-sub {
  width: 100%;
}

.result-secondary-copy h3 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  margin-bottom: 8px;
  letter-spacing: -0.03em;
}

.result-secondary-copy p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
  font-size: 0.87rem;
}

.secondary-meta {
  margin-top: 8px;
  color: #677484;
  font-size: 0.8rem;
}

.suggestion-list {
  display: grid;
  gap: 10px;
}

.suggestion-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.72);
}

.suggestion-item > div {
  min-width: 0;
}

.suggestion-item h3 {
  font-family: var(--font-display);
  font-size: 1.18rem;
  margin-bottom: 4px;
  letter-spacing: -0.03em;
}

.suggestion-item p {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.result-muted {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .hero-panel {
    justify-self: start;
    max-width: 480px;
  }

  .quiz-card {
    grid-column: span 6;
  }

  .section-header {
    align-items: flex-start;
  }

  .quiz-intro-head {
    grid-template-columns: 1fr;
    display: grid;
  }

  .result-page-actions {
    justify-content: flex-start;
  }

  .result-main-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .result-secondary-list {
    grid-template-columns: 1fr;
  }

  .result-hero-clean {
    flex-direction: column;
  }

  .result-page-actions {
    width: 100%;
  }
}

@media (max-width: 620px) {
  .site-shell {
    padding: 20px 14px 36px;
  }

  .section-header,
  .library-toolbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .section-header {
    gap: 14px;
  }

  .library-filter-select {
    width: 100%;
    max-width: none;
    min-width: 0;
  }

  .quiz-main,
  .hero,
  .quiz-card,
  .result-main-card,
  .result-clean-section {
    padding: 16px;
  }

  h1 {
    font-size: clamp(2.4rem, 12vw, 3.5rem);
    line-height: 0.94;
  }

  .topbar {
    flex-wrap: wrap;
    align-items: baseline;
    margin-bottom: 16px;
  }

  .result-secondary-row,
  .suggestion-item {
    flex-direction: column;
    align-items: flex-start;
  }

  .result-secondary-row .btn,
  .suggestion-item .btn {
    width: 100%;
  }

  .hero-metrics {
    gap: 8px;
  }

  .hero-metrics span,
  .library-toolbar {
    width: 100%;
  }

  .hero-actions .btn,
  .quiz-card-footer .btn,
  .result-page-actions .btn,
  .suggestion-item .btn,
  .result-secondary-row .btn,
  .quiz-nav .btn {
    width: 100%;
    justify-content: center;
  }

  .hero-panel {
    padding-top: 8px;
    max-width: none;
  }

  .question-title,
  .quiz-intro-title,
  .result-page-title {
    max-width: none;
  }

  .hero-subtitle,
  .section-subtitle,
  .result-page-summary,
  .result-note,
  .question-helper {
    max-width: none;
  }

  .quiz-card h3,
  .section-header > :first-child,
  .quiz-intro-head > :first-child,
  .hero-copy {
    max-width: none;
  }

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

  .quiz-card {
    grid-column: auto;
  }

  .quiz-card p {
    max-width: none;
  }

  .quiz-nav,
  .result-page-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .quiz-card {
    min-height: 0;
  }
}
