:root {
  --page: #efefef;
  --ink: #153a4a;
  --muted: #5d6e76;
  --card: #ffffff;
  --accent: #12afe4;
  --accent-dark: #087da8;
  --soft: #d9edf5;
  --line: #cad5da;
  --focus: #1a6f96;
  --danger: #a43131;
  --success: #226847;
  --shadow: 0 14px 34px rgba(18, 58, 74, 0.08);
}

* { box-sizing: border-box; }
html { background: var(--page); }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--page);
  color: var(--ink);
  font-family: "Poppins", Arial, sans-serif;
  line-height: 1.55;
}
button, input { font: inherit; }
button, a, label { -webkit-tap-highlight-color: transparent; }

.site-shell {
  width: min(100% - 28px, 960px);
  margin: 0 auto;
  padding: 34px 0 52px;
}

.hero {
  text-align: center;
  max-width: 760px;
  margin: 0 auto 26px;
}
.hero h1 {
  font-family: "Fredericka the Great", Georgia, serif;
  font-weight: 400;
  font-size: clamp(2.15rem, 7vw, 4rem);
  line-height: 1.04;
  margin: 0 0 12px;
  letter-spacing: .01em;
}
.hero p {
  margin: 0 auto;
  max-width: 700px;
  color: var(--muted);
  font-size: 1rem;
}
.hero-art {
  display: block;
  width: min(100%, 720px);
  max-height: 250px;
  object-fit: contain;
  margin: 18px auto 0;
}

.panel {
  background: var(--card);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: clamp(22px, 4vw, 42px);
}

.intro-stack {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.intro-copy {
  width: 100%;
}
.eyebrow {
  margin: 0 0 8px;
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--accent-dark);
}

.intro-kicker {
  font-size: 1.08rem;
  margin-bottom: 18px !important;
}
.intro-ready {
  margin-top: 22px !important;
  margin-bottom: 16px !important;
}
.intro-art {
  display: block;
  width: min(100%, 430px);
  max-height: 150px;
  object-fit: contain;
  margin: 0 auto 2px;
  background: transparent;
}

.panel h2, .result-copy h2 {
  margin: 0 0 10px;
  font-size: clamp(1.45rem, 4vw, 2.1rem);
  line-height: 1.2;
}
.panel p { margin: 0 0 14px; }
.small { color: var(--muted); font-size: .9rem; }

.primary-btn, .secondary-btn, .text-btn {
  border-radius: 999px;
  min-height: 48px;
  padding: 11px 22px;
  font-weight: 700;
  cursor: pointer;
  transition: transform .12s ease, opacity .12s ease, background .12s ease;
}
.primary-btn {
  border: 2px solid var(--accent);
  background: var(--accent);
  color: #052c3b;
}
.secondary-btn {
  border: 2px solid var(--ink);
  background: transparent;
  color: var(--ink);
}
.text-btn {
  border: 0;
  background: transparent;
  color: var(--ink);
  padding-left: 0;
  padding-right: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.primary-btn:hover, .secondary-btn:hover { transform: translateY(-1px); }
.primary-btn:disabled, .secondary-btn:disabled {
  opacity: .42;
  cursor: not-allowed;
  transform: none;
}
.primary-btn:focus-visible, .secondary-btn:focus-visible, .text-btn:focus-visible,
.answer:focus-within, input:focus-visible, a:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--focus) 45%, white);
  outline-offset: 3px;
}

.progress-wrap { margin: 0 0 26px; }
.progress-top {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: baseline;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: .88rem;
}
.progress-track {
  height: 8px;
  background: #e1e7ea;
  border-radius: 999px;
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
  transition: width .22s ease;
}

.question-card h2 { margin-bottom: 8px; }
.instruction {
  margin: 0 0 20px;
  font-weight: 600;
  color: var(--muted);
}
.answer-list {
  display: grid;
  gap: 10px;
  margin: 0 0 26px;
}
.answer {
  display: flex;
  gap: 13px;
  align-items: flex-start;
  padding: 15px 16px;
  border: 2px solid #d5dfe3;
  border-radius: 13px;
  background: #fff;
  cursor: pointer;
  transition: border .12s ease, background .12s ease;
}
.answer:hover { border-color: #9dcada; }
.answer.selected {
  border-color: var(--accent-dark);
  background: #f1fbfe;
}
.answer input {
  width: 19px;
  height: 19px;
  margin-top: 2px;
  accent-color: var(--accent-dark);
  flex: 0 0 auto;
}
.answer span { font-size: .98rem; }
.nav-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.nav-row .spacer { flex: 1; }

.results-shell { display: grid; gap: 18px; }
.result-showcase {
  background: transparent;
}
.primary-hero-image {
  background: #fff;
  overflow: hidden;
}
.primary-hero-image img {
  display: block;
  width: 100%;
  height: auto;
}
.result-showcase-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 30px;
  align-items: start;
  padding: 28px 28px 0;
}
.primary-result-feature {
  padding: 0 0 18px;
}
.primary-rule {
  width: 100%;
  height: 7px;
  background: #a34f69;
  margin: 0 0 22px;
}
.result-label {
  margin: 0 0 7px;
  font-size: .82rem;
  color: #a34f69;
  text-transform: uppercase;
  letter-spacing: .09em;
  font-weight: 700;
}
.primary-result-name {
  margin: 0 0 16px;
  font-family: "Fredericka the Great", Georgia, serif;
  font-weight: 400;
  font-size: clamp(2.5rem, 6vw, 4.6rem);
  line-height: 1;
}
.primary-result-description {
  margin: 0;
  max-width: 720px;
  font-size: 1.08rem;
  line-height: 1.7;
}
.secondary-result-card {
  background: #fff;
  border: 1px solid var(--line);
  overflow: hidden;
}
.secondary-result-image {
  display: block;
  width: 100%;
  height: 185px;
  object-fit: contain;
  background: #fff;
}
.secondary-result-copy {
  padding: 18px 20px 22px;
}
.secondary-result-name {
  margin: 0 0 14px;
  font-size: 1.55rem;
  line-height: 1.16;
  word-break: normal;
  overflow-wrap: normal;
  hyphens: none;
}
.secondary-result-copy p:last-child {
  margin: 0;
}
.result-card {
  background: var(--card);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: clamp(20px, 4vw, 36px);
}
.tie-note {
  background: #f0f7fa;
  border-left: 4px solid var(--accent-dark);
  padding: 12px 14px;
  margin: 18px 28px 0;
}

.email-card {
  background: var(--ink);
  color: #fff;
}
.email-card h2, .email-card p { color: #fff; }
.email-card .small { color: #d7e6ec; }
.email-form {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 10px;
  margin-top: 18px;
}
.email-form input[type="text"], .email-form input[type="email"] {
  width: 100%;
  min-height: 48px;
  border: 2px solid transparent;
  border-radius: 10px;
  padding: 10px 13px;
  color: #153a4a;
  background: #fff;
}
.optin-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-top: 14px;
  font-size: .86rem;
  color: #d7e6ec;
}
.optin-row input { margin-top: 4px; }
.status {
  min-height: 1.4em;
  margin-top: 12px;
  font-size: .9rem;
}
.status.error { color: #ffd5d5; }
.status.success { color: #c8f2db; }

.recommendations {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 17px;
}
.recommendation {
  display: block;
  color: var(--ink);
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  background: #fff;
}
.recommendation strong { display: block; margin-bottom: 4px; }
.recommendation span { color: var(--muted); font-size: .88rem; }

.footer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
}
.footer-actions a { color: var(--ink); font-weight: 600; }

.screen-reader-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 760px) {
  .site-shell { width: min(100% - 20px, 960px); padding-top: 22px; }
  .result-showcase-grid { grid-template-columns: 1fr; padding: 22px 0 0; }
  .primary-hero-image img { width: 100%; height: auto; }
  .secondary-result-card { max-width: 520px; }
  .tie-note { margin-left: 0; margin-right: 0; }
  .archetype-image-wrap { min-height: 0; }
  .email-form { grid-template-columns: 1fr; }
  .recommendations { grid-template-columns: 1fr; }
  .nav-row { align-items: stretch; }
  .nav-row .primary-btn, .nav-row .secondary-btn { flex: 1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}

/* Intro alignment refinement: keep the title and artwork aligned to the same left edge. */
.hero {
  text-align: left;
  max-width: none;
  margin: 0 0 26px;
  padding-inline: clamp(22px, 4vw, 42px);
}
.hero h1 {
  white-space: nowrap;
}
.intro-art {
  margin: 0 0 2px;
  width: min(100%, 430px);
  max-height: 150px;
}

@media (max-width: 760px) {
  .hero { padding-inline: clamp(22px, 4vw, 42px); }
  .hero h1 { white-space: normal; }
  .intro-art { width: min(100%, 430px); }
}

/* Final results-page refinements only. Intro page intentionally unchanged. */
@media (min-width: 761px) {
  .primary-hero-image {
    width: calc(100% - 56px);
    margin: 0 auto;
  }

  .primary-result-name {
    font-size: clamp(2.65rem, 4.35vw, 3.9rem);
    line-height: 1.02;
    max-width: 100%;
    white-space: normal;
    word-break: normal;
    overflow-wrap: normal;
  }
}

@media (max-width: 760px) {
  .primary-hero-image {
    width: 100%;
    margin: 0;
  }

  .primary-result-name {
    font-size: clamp(2.15rem, 11vw, 3.35rem);
    line-height: 1.04;
    white-space: normal;
    word-break: normal;
    overflow-wrap: normal;
  }
}

/* Final typography safety pass: readable wrapping without splitting words. */
body,
button,
input,
label,
a,
p,
span,
h1,
h2,
h3,
h4,
li,
.answer,
.recommendation,
.result-showcase,
.result-card {
  word-break: normal;
  overflow-wrap: normal;
  hyphens: manual;
}

.result-showcase-grid > *,
.primary-result-feature,
.secondary-result-card,
.secondary-result-copy {
  min-width: 0;
}

/* Preserve the approved secondary card while making every archetype title fit cleanly. */
.secondary-result-name {
  font-size: clamp(1.18rem, 1.55vw, 1.42rem);
  line-height: 1.22;
  letter-spacing: -0.01em;
  word-break: normal;
  overflow-wrap: normal;
  hyphens: manual;
  text-wrap: balance;
}

/* Keep primary names large, but never so large that long archetype names overflow. */
.primary-result-name {
  font-size: clamp(2.45rem, 3.9vw, 3.55rem);
  line-height: 1.04;
  letter-spacing: 0;
  word-break: normal;
  overflow-wrap: normal;
  hyphens: manual;
  text-wrap: balance;
}

.primary-result-description,
.secondary-result-copy p,
.result-card p,
.recommendation span,
.answer span {
  word-break: normal;
  overflow-wrap: normal;
  hyphens: manual;
}

@media (max-width: 760px) {
  .primary-result-name {
    font-size: clamp(2.05rem, 10vw, 3rem);
    line-height: 1.06;
  }

  .secondary-result-name {
    font-size: clamp(1.2rem, 5.8vw, 1.55rem);
    line-height: 1.22;
  }
}
