:root {
  --paper: #eee8de;
  --paper-deep: #ded4c6;
  --ink: #171412;
  --muted: #675f58;
  --red: #9e1d2a;
  --line: #bdb2a5;
  --white: #fffdf8;
  --content: 720px;
  --radius: 18px;
  --display: "Songti SC", "STSong", "Noto Serif CJK SC", Georgia, serif;
  --body: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --utility: ui-monospace, "SFMono-Regular", Menlo, Monaco, Consolas, monospace;
  color-scheme: light;
  font-family: var(--body);
  font-synthesis: none;
  line-height: 1.5;
  color: var(--ink);
  background: var(--paper);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  scroll-behavior: smooth;
  background: var(--ink);
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background-color: var(--paper);
  background-image: repeating-linear-gradient(
    90deg,
    rgb(23 20 18 / 0.018) 0,
    rgb(23 20 18 / 0.018) 1px,
    transparent 1px,
    transparent 7px
  );
}

button,
input,
textarea,
select {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

:focus-visible {
  outline: 3px solid var(--red);
  outline-offset: 4px;
}

::selection {
  color: var(--white);
  background: var(--red);
}

.site-shell {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 100vh;
  overflow: clip;
}

.masthead {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  width: min(calc(100% - 32px), var(--content));
  margin-inline: auto;
  padding-block: 20px 14px;
  border-bottom: 1px solid var(--ink);
}

.wordmark {
  font-family: var(--display);
  font-size: clamp(0.92rem, 2.5vw, 1.08rem);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-decoration: none;
}

.issue-no,
.kicker,
.hero-meta,
.route-heading,
.progress,
.result-label,
.footer-note,
.toast,
.issue-rail {
  font-family: var(--utility);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.issue-no {
  margin: 0;
  color: var(--muted);
  font-size: 0.67rem;
  white-space: nowrap;
}

main {
  width: min(calc(100% - 32px), var(--content));
  margin-inline: auto;
}

main:focus {
  outline: none;
}

.hero {
  display: grid;
  align-content: center;
  min-height: clamp(620px, calc(100svh - 142px), 790px);
  padding-block: clamp(56px, 9vw, 96px);
}

.kicker {
  width: fit-content;
  margin: 0 0 24px;
  padding: 6px 10px;
  border: 1px solid var(--red);
  color: var(--red);
  font-size: 0.66rem;
  font-weight: 700;
}

.hero h1 {
  max-width: 12ch;
  margin: 0;
  font-family: var(--display);
  font-size: clamp(2.75rem, 10vw, 6.35rem);
  font-weight: 700;
  line-height: 0.94;
  letter-spacing: -0.075em;
}

.hero h1 cite {
  color: var(--red);
  font-style: normal;
  white-space: nowrap;
}

.hero-deck {
  max-width: 35rem;
  margin: 26px 0 32px;
  color: var(--muted);
  font-family: var(--display);
  font-size: clamp(1rem, 3vw, 1.2rem);
  line-height: 1.8;
}

.route-dossier {
  position: relative;
  margin: 0 0 30px;
  padding: 14px 20px 18px;
  border-block: 1px solid var(--ink);
  background: rgb(255 253 248 / 0.38);
}

.route-heading {
  display: flex;
  justify-content: space-between;
  margin-bottom: 17px;
  color: var(--muted);
  font-size: 0.58rem;
  font-weight: 700;
}

.route-stops {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 0;
  margin: 0;
  padding: 0 50px 0 0;
  list-style: none;
}

.route-stops li {
  position: relative;
  min-width: 0;
  border-top: 1px dashed var(--line);
}

.route-stops li::before {
  position: absolute;
  top: -4px;
  left: 0;
  width: 7px;
  height: 7px;
  border: 1px solid var(--ink);
  border-radius: 50%;
  background: var(--paper);
  content: "";
}

.route-stops li:last-child {
  border-color: transparent;
}

.route-stops span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-family: var(--utility);
  font-size: 0.48rem;
  font-variant-numeric: tabular-nums;
}

.stamp {
  position: absolute;
  right: 7px;
  bottom: -13px;
  display: grid;
  place-content: center;
  width: 70px;
  height: 70px;
  transform: rotate(-9deg);
  border: 2px solid var(--red);
  border-radius: 50%;
  color: var(--red);
  text-align: center;
  box-shadow: inset 0 0 0 3px var(--paper), inset 0 0 0 4px var(--red);
}

.stamp strong {
  font-family: var(--display);
  font-size: 1.5rem;
  line-height: 0.9;
}

.stamp small {
  margin-top: 4px;
  font-family: var(--utility);
  font-size: 0.47rem;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: min(100%, 320px);
  min-height: 52px;
  padding: 14px 18px;
  border: 1px solid var(--ink);
  border-radius: 0;
  color: var(--white);
  background: var(--ink);
  font-weight: 700;
  cursor: pointer;
  transition: color 180ms ease, background-color 180ms ease,
    transform 180ms ease;
}

.primary-button span {
  color: var(--paper-deep);
  font-size: 1.35rem;
  line-height: 1;
}

.primary-button:active {
  transform: translateY(1px);
}

.hero-meta {
  margin: 11px 0 0;
  color: var(--muted);
  font-size: 0.59rem;
}

/* Intro view */
.intro-card {
  display: grid;
  align-content: center;
  min-height: clamp(520px, calc(100svh - 142px), 720px);
  padding-block: clamp(48px, 10vw, 100px);
}

.intro-card h1 {
  max-width: 11ch;
  margin: 0;
  font-family: var(--display);
  font-size: clamp(2.6rem, 9vw, 5.6rem);
  line-height: 0.98;
  letter-spacing: -0.065em;
}

.intro-copy {
  max-width: 34rem;
  margin: 30px 0 34px;
  padding-left: 18px;
  border-left: 3px solid var(--red);
  color: var(--muted);
  font-family: var(--display);
  font-size: clamp(1.05rem, 3vw, 1.3rem);
  line-height: 1.8;
}

.intro-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px 24px;
}

.text-link,
.text-button {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 4px 0;
  border: 0;
  color: var(--muted);
  background: transparent;
  font-weight: 700;
  cursor: pointer;
}

/* Quiz view */
.quiz-card,
.result-card,
.analysis-card {
  margin-block: clamp(32px, 7vw, 72px);
  border: 1px solid var(--ink);
  background: var(--white);
  box-shadow: 8px 8px 0 var(--paper-deep);
}

.quiz-card {
  padding: clamp(20px, 5vw, 42px);
}

.progress {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  margin-bottom: clamp(26px, 6vw, 48px);
  color: var(--muted);
  font-size: 0.62rem;
  font-variant-numeric: tabular-nums;
}

.progress-track {
  height: 3px;
  overflow: hidden;
  background: var(--paper-deep);
}

.progress-value {
  width: var(--progress, 0%);
  height: 100%;
  background: var(--red);
  transition: width 260ms ease;
}

.question-label {
  margin: 0 0 12px;
  color: var(--red);
  font-family: var(--utility);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.question-title {
  margin: 0 0 28px;
  font-family: var(--display);
  font-size: clamp(1.55rem, 5vw, 2.35rem);
  line-height: 1.35;
}

.option-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  border: 0;
}

.option {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
  width: 100%;
  min-height: 52px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: border-color 160ms ease, background-color 160ms ease,
    transform 160ms ease;
}

.option-marker {
  color: var(--red);
  font-family: var(--utility);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.75;
}

.option[aria-pressed="true"],
.option.is-selected {
  border-color: var(--red);
  background: rgb(158 29 42 / 0.07);
}

.selection-mark {
  align-self: center;
  color: var(--ink);
  font-family: var(--utility);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.quiz-navigation {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 22px;
  color: var(--muted);
  font-family: var(--utility);
  font-size: 0.62rem;
  letter-spacing: 0.06em;
}

/* Analysis and result views */
.analysis-card {
  display: grid;
  place-items: center;
  min-height: min(65vh, 480px);
  padding: 36px;
  text-align: center;
}

.analysis-mark {
  display: grid;
  place-content: center;
  width: 88px;
  height: 88px;
  margin-bottom: 20px;
  border: 1px dashed var(--red);
  border-radius: 50%;
  color: var(--red);
  font-family: var(--utility);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  animation: dossier-turn 2.8s linear infinite;
}

.analysis-card h1 {
  margin: 0 0 10px;
  font-family: var(--display);
  font-size: clamp(1.7rem, 5vw, 2.4rem);
}

.analysis-card p {
  margin: 0;
  color: var(--muted);
}

.analysis-steps {
  display: grid;
  gap: 8px;
  margin: 24px 0 0;
  padding: 0;
  color: var(--muted);
  font-family: var(--utility);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  list-style: none;
}

.analysis-steps li::before {
  margin-right: 8px;
  color: var(--red);
  content: "●";
}

.analysis-steps li {
  animation: analysis-step 400ms ease both;
}

.analysis-steps li:nth-child(2) {
  animation-delay: 400ms;
}

.analysis-steps li:nth-child(3) {
  animation-delay: 800ms;
}

.result-card {
  overflow: hidden;
}

.result-hero {
  padding: clamp(24px, 6vw, 52px);
  color: var(--white);
  background: var(--ink);
}

.result-label {
  margin: 0 0 18px;
  color: var(--paper-deep);
  font-size: 0.62rem;
}

.result-name {
  margin: 0;
  color: var(--white);
  font-family: var(--display);
  font-size: clamp(3.2rem, 13vw, 6.8rem);
  line-height: 0.95;
  letter-spacing: -0.07em;
}

.result-archetype {
  width: fit-content;
  margin: 20px 0 0;
  padding: 6px 9px;
  border: 1px solid var(--red);
  color: var(--white);
  font-family: var(--utility);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
}

.result-grid {
  display: grid;
  background: var(--line);
  gap: 1px;
}

.result-section {
  min-width: 0;
  padding: clamp(22px, 5vw, 36px);
  background: var(--white);
}

.result-section h2,
.result-section h3 {
  margin: 0 0 12px;
  font-family: var(--display);
  font-size: 1.2rem;
}

.result-section p,
.result-section ul {
  margin: 0;
  color: var(--muted);
  line-height: 1.75;
}

.result-section ul {
  padding-left: 1.2em;
}

.result-summary {
  font-family: var(--display);
  font-size: clamp(1.25rem, 4vw, 1.7rem);
  line-height: 1.55;
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: clamp(22px, 5vw, 36px);
  border-top: 1px solid var(--line);
  background: var(--white);
}

.confirm-panel {
  padding: clamp(22px, 5vw, 36px);
  border-top: 1px solid var(--ink);
  background: var(--paper-deep);
}

.confirm-panel h2 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(1.5rem, 5vw, 2rem);
}

.confirm-panel > p:not(.question-label) {
  margin: 9px 0 20px;
  color: var(--muted);
}

.confirm-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.copy-source {
  position: fixed;
  left: -9999px;
  width: 1px;
  height: 1px;
}

.manual-copy-panel {
  padding: clamp(22px, 5vw, 36px);
  border-top: 1px solid var(--ink);
  background: var(--paper-deep);
}

.manual-copy-panel h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 1.3rem;
}

.manual-copy-panel p {
  margin: 8px 0 14px;
  color: var(--muted);
}

.manual-copy-text {
  display: block;
  width: 100%;
  min-height: 8rem;
  padding: 12px;
  resize: vertical;
  border: 1px solid var(--ink);
  border-radius: 0;
  color: var(--ink);
  background: var(--white);
  line-height: 1.6;
}

.secondary-button {
  min-height: 48px;
  padding: 12px 18px;
  border: 1px solid var(--ink);
  border-radius: 0;
  color: var(--ink);
  background: transparent;
  font-weight: 700;
  cursor: pointer;
}

.toast {
  position: fixed;
  z-index: 10;
  right: 16px;
  bottom: 16px;
  max-width: min(360px, calc(100% - 32px));
  padding: 14px 16px;
  border-left: 4px solid var(--red);
  color: var(--white);
  background: var(--ink);
  box-shadow: 4px 4px 0 rgb(158 29 42 / 0.28);
  font-size: 0.66rem;
  animation: toast-enter 220ms ease-out both;
}

.footer-note {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  width: min(calc(100% - 32px), var(--content));
  margin-inline: auto;
  padding-block: 17px 24px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.72rem;
}

.footer-note p {
  margin: 0;
}

.footer-note p:first-child {
  letter-spacing: 0;
  line-height: 1.7;
}

.issue-rail {
  display: none;
}

.noscript-note {
  position: fixed;
  right: 16px;
  bottom: 16px;
  left: 16px;
  z-index: 20;
  max-width: 680px;
  margin-inline: auto;
  padding: 14px 16px;
  border: 1px solid var(--ink);
  color: var(--white);
  background: var(--red);
  text-align: center;
}

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

@keyframes dossier-turn {
  to {
    transform: rotate(360deg);
  }
}

@keyframes toast-enter {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

@keyframes analysis-step {
  from {
    opacity: 0.25;
  }

  to {
    opacity: 1;
  }
}

@media (hover: hover) {
  .primary-button:hover {
    color: var(--ink);
    background: var(--paper-deep);
  }

  .option:hover {
    border-color: var(--red);
    background: rgb(158 29 42 / 0.045);
    transform: translateX(3px);
  }

  .secondary-button:hover {
    color: var(--white);
    background: var(--ink);
  }

  .text-link:hover,
  .text-button:hover {
    color: var(--red);
  }
}

@media (min-width: 700px) {
  .result-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .result-section--wide {
    grid-column: 1 / -1;
  }
}

@media (min-width: 980px) {
  .issue-rail {
    position: absolute;
    top: 50%;
    left: max(18px, calc((100vw - var(--content)) / 2 - 112px));
    display: flex;
    justify-content: space-between;
    width: min(58vh, 510px);
    color: var(--muted);
    font-size: 0.54rem;
    pointer-events: none;
    transform: translate(-50%, -50%) rotate(-90deg);
  }

  .issue-rail::before {
    position: absolute;
    top: 50%;
    right: 112px;
    left: 128px;
    border-top: 1px solid var(--line);
    content: "";
  }
}

@media (max-width: 430px) {
  .masthead {
    padding-top: 16px;
  }

  .hero {
    min-height: auto;
  }

  .hero h1 {
    font-size: clamp(2.7rem, 14vw, 3.65rem);
  }

  .hero h1 cite {
    white-space: normal;
  }

  .hero-deck {
    margin-block: 22px 26px;
  }

  .route-dossier {
    margin-bottom: 38px;
    padding-inline: 12px;
  }

  .route-stops {
    padding-right: 42px;
  }

  .route-stops span {
    font-size: 0.42rem;
  }

  .stamp {
    right: -5px;
    width: 62px;
    height: 62px;
  }

  .primary-button {
    width: 100%;
  }

  .footer-note {
    display: block;
  }

  .footer-note p + p {
    margin-top: 5px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
