:root {
  --ink: #241822;
  --muted: #6e6269;
  --paper: #fff8f2;
  --ivory: #fffdf9;
  --blush: #f8e4df;
  --rose-soft: #f2c5bc;
  --rose: #bb5267;
  --berry: #8d2946;
  --plum: #421d32;
  --apricot: #eba97e;
  --champagne: #cda45f;
  --white: #ffffff;
  --line: rgba(66, 29, 50, 0.14);
  --shadow: 0 22px 60px rgba(66, 29, 50, 0.14);
  --font-sans: "HarmonyOS Sans SC", "MiSans", "OPPO Sans", "Alibaba PuHuiTi", "Source Han Sans SC", "Noto Sans CJK SC", "Microsoft YaHei UI", "Microsoft YaHei", "Segoe UI", Arial, sans-serif;
  --font-display: "HarmonyOS Sans SC", "MiSans", "Alibaba PuHuiTi", "Source Han Sans SC", "Noto Sans CJK SC", "Microsoft YaHei UI", "Microsoft YaHei", "Segoe UI", Arial, sans-serif;
  --teal: var(--rose);
  --peach: var(--champagne);
  --navy: var(--plum);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(187, 82, 103, 0.045) 1px, transparent 1px),
    linear-gradient(180deg, rgba(205, 164, 95, 0.05) 1px, transparent 1px),
    var(--paper);
  background-size: 54px 54px;
  overflow-x: hidden;
}

.bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(255, 248, 242, 0.98) 0%, rgba(255, 248, 242, 0.88) 48%, rgba(255, 248, 242, 0.52) 100%),
    linear-gradient(180deg, rgba(66, 29, 50, 0.03) 0%, rgba(255, 248, 242, 0.86) 100%),
    url("./assets/hero-newborn-art.jpg") center / cover no-repeat;
  opacity: 0.9;
}

button {
  border: 0;
  cursor: pointer;
  font: inherit;
}

button:disabled {
  cursor: default;
  opacity: 0.34;
}

.topbar {
  width: min(1180px, calc(100vw - 40px));
  margin: 18px auto 0;
  padding: 12px 14px 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 8px;
  background: rgba(255, 248, 242, 0.88);
  box-shadow: 0 14px 36px rgba(66, 29, 50, 0.11);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: var(--plum);
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 900;
}

.brand-mark {
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: linear-gradient(135deg, #ffe3d5, #f6c0bf 55%, #e1bd73);
}

.brand-mark svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: var(--plum);
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.header-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.home-link {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid rgba(66, 29, 50, 0.16);
  border-radius: 8px;
  color: var(--plum);
  background: rgba(255, 255, 255, 0.78);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 900;
  text-decoration: none;
}

.home-link:hover,
.home-link:focus-visible {
  color: var(--white);
  background: linear-gradient(135deg, var(--plum), var(--berry));
  outline: none;
}

.icon-button {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  color: var(--plum);
  font-size: 22px;
}

.app-shell {
  width: min(980px, calc(100vw - 40px));
  margin: 28px auto 42px;
}

.selection-card,
.flow-card {
  border: 1px solid rgba(255, 255, 255, 0.76);
  border-radius: 8px;
  background: rgba(255, 248, 242, 0.9);
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px);
}

.selection-card {
  padding: clamp(18px, 4vw, 34px);
  min-height: min(720px, calc(100vh - 156px));
  display: grid;
  align-content: start;
}

.character-stage {
  height: clamp(210px, 34vw, 318px);
  display: flex;
  justify-content: center;
  align-items: end;
  gap: clamp(4px, 2vw, 22px);
  overflow: hidden;
  border-bottom: 1px solid rgba(17, 24, 39, 0.08);
  margin: calc(clamp(18px, 4vw, 34px) * -1) calc(clamp(18px, 4vw, 34px) * -1) 26px;
  padding: 20px 18px 0;
  background: linear-gradient(180deg, rgba(255, 253, 249, 0.82), rgba(248, 228, 223, 0.22));
}

.character {
  height: 100%;
  width: min(29vw, 190px);
  object-fit: contain;
  object-position: bottom center;
  opacity: 0.28;
  filter: grayscale(0.08) saturate(0.82);
  transform: translateY(14px) scale(0.94);
  transition: opacity 240ms ease, transform 240ms ease, filter 240ms ease;
}

.character.active {
  opacity: 1;
  filter: none;
  transform: translateY(0) scale(1.02);
}

.selection-card:not(.is-male-path):not(.is-female-path) .character {
  opacity: 0.92;
  filter: none;
}

.selection-card.is-male-path:not(.has-partner) .character-female,
.selection-card.is-female-path:not(.needs-helper) .character-male {
  display: none;
}

.selection-card.is-male-path:not(.needs-helper) .character-helper,
.selection-card.is-female-path:not(.needs-helper) .character-helper {
  display: none;
}

.selection-card.has-partner .character-helper {
  display: none;
}

.selection-card.needs-helper .character-helper {
  opacity: 1;
  filter: none;
  transform: translateY(0) scale(1);
}

.selection-copy {
  max-width: 720px;
}

.section-kicker {
  color: var(--berry);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  margin-top: 9px;
  color: var(--plum);
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(34px, 7vw, 58px);
  line-height: 1.04;
}

h2 {
  margin-top: 9px;
  color: var(--plum);
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(29px, 6vw, 48px);
  line-height: 1.08;
}

p {
  margin: 0;
  line-height: 1.62;
}

#questionHelp,
#routeNote {
  color: var(--muted);
  margin-top: 12px;
}

.question-dots {
  display: flex;
  gap: 8px;
  margin-top: 20px;
}

.question-dot {
  width: 28px;
  height: 4px;
  border-radius: 999px;
  background: rgba(17, 24, 39, 0.14);
}

.question-dot.done,
.question-dot.active {
  background: linear-gradient(90deg, var(--rose), var(--champagne));
}

.choices {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 30px;
}

.choice {
  min-height: 108px;
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 14px;
  align-items: center;
  text-align: left;
  padding: 16px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  color: var(--ink);
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.choice:hover,
.choice.selected {
  transform: translateY(-2px);
  border-color: rgba(187, 82, 103, 0.48);
  background: rgba(255, 253, 249, 0.96);
  box-shadow: 0 14px 34px rgba(66, 29, 50, 0.1);
}

.choice-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--blush);
  color: var(--berry);
  font-weight: 700;
}

.choice-copy strong {
  display: block;
  font-size: 18px;
  margin-bottom: 4px;
}

.choice-copy small {
  display: block;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.48;
}

.route-summary {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid rgba(17, 24, 39, 0.08);
}

.route-summary span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 6px;
}

.route-summary p {
  font-weight: 700;
}

.flow-view {
  display: grid;
  gap: 18px;
}

.flow-top {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 2px 0;
}

.text-button {
  min-width: 88px;
  padding: 10px 12px;
  border: 1px solid rgba(66, 29, 50, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--plum);
  font-weight: 900;
  box-shadow: 0 10px 28px rgba(66, 29, 50, 0.08);
}

.flow-progress {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.progress-track {
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(17, 24, 39, 0.12);
}

.progress-track i {
  display: block;
  height: 100%;
  min-width: 6%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--berry), var(--rose), var(--champagne));
  transition: width 220ms ease;
}

.flow-card {
  padding: clamp(22px, 5vw, 44px);
}

.stage-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--berry);
  font-weight: 700;
}

.stage-meta span {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--blush);
}

.stage-meta small {
  font-size: 14px;
}

.stage-main {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 18px;
  align-items: start;
  margin-top: 24px;
}

.stage-icon {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #fff;
  color: var(--plum);
  font-size: 30px;
  box-shadow: inset 0 0 0 1px var(--line);
}

.stage-main h3 {
  color: var(--plum);
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(31px, 6vw, 54px);
  line-height: 1.02;
}

.stage-main p {
  color: var(--muted);
  margin-top: 12px;
  font-size: 17px;
}

.flow-card ul {
  margin: 26px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
  color: var(--muted);
}

.flow-card li {
  position: relative;
  padding-left: 20px;
  line-height: 1.58;
}

.flow-card li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.78em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--berry);
}

.flow-actions {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) 58px;
  align-items: center;
  gap: 14px;
}

.arrow-button {
  width: 58px;
  height: 58px;
  border: 1px solid rgba(66, 29, 50, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--plum);
  box-shadow: 0 16px 40px rgba(66, 29, 50, 0.1);
  font-size: 36px;
  line-height: 1;
}

.pager-text {
  min-height: 48px;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--muted);
  font-weight: 700;
}

.stage-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 2px 8px;
  scrollbar-width: none;
}

.stage-strip::-webkit-scrollbar {
  display: none;
}

.stage-marker {
  flex: 0 0 auto;
  min-width: 38px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(255, 253, 249, 0.78);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  border: 1px solid rgba(17, 24, 39, 0.08);
}

.stage-marker.done {
  color: var(--berry);
  background: rgba(187, 82, 103, 0.1);
}

.stage-marker.active {
  color: #fff;
  background: linear-gradient(135deg, var(--plum), var(--berry));
}

.site-footer {
  position: relative;
  height: 44px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, var(--plum), var(--berry) 58%, var(--champagne));
  backdrop-filter: blur(16px);
  font-weight: 700;
}

.is-hidden {
  display: none !important;
}

@media (max-width: 720px) {
  .topbar,
  .app-shell {
    width: min(100% - 24px, 980px);
  }

  .topbar {
    padding-top: 16px;
  }

  .brand {
    font-size: 14px;
  }

  .home-link {
    min-height: 38px;
    padding: 0 10px;
    font-size: 12px;
  }

  .app-shell {
    margin-top: 18px;
  }

  .selection-card {
    min-height: calc(100vh - 130px);
  }

  .character-stage {
    height: 236px;
  }

  .character {
    width: 31vw;
  }

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

  .choice {
    min-height: 96px;
  }

  .flow-top {
    display: grid;
  }

  .text-button {
    justify-self: start;
  }

  .stage-main {
    grid-template-columns: 1fr;
  }

  .stage-icon {
    width: 62px;
    height: 62px;
  }

  .flow-actions {
    grid-template-columns: 52px minmax(0, 1fr) 52px;
  }

  .arrow-button {
    width: 52px;
    height: 52px;
  }
}

@media (max-width: 420px) {
  .character-stage {
    height: 212px;
    gap: 0;
  }

  .character {
    width: 34vw;
  }

  .selection-card:not(.is-male-path):not(.is-female-path) .character-helper {
    display: none;
  }
}
