/* index.html only: the two-person story. Tokens, type, focus ring and the .choice buttons come
   from styles.css. Mobile first: one person above the other, then side by side. */

.story .masthead, .story main, .story .page-footer { max-width: 62rem; }
.story main { margin-bottom: 3rem; }
.story main > section { margin-top: 2.25rem; }
.story-kind { margin: 0; padding: 0.5rem 0; font-size: 0.9375rem; color: var(--muted); }

/* ---- what the two people share: a quiet strip, label above value ---- */
.shared { padding: 0.85rem 0 0.25rem; border-top: 1px solid var(--ink); }
.shared h2 { font: 600 0.9375rem/1.3 var(--sans); margin: 0 0 0.6rem; }
.shared-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem 1.5rem; margin: 0; }
.shared-list dt { font-size: 0.8125rem; }

@media (min-width: 44rem) {
  .shared-list { grid-template-columns: repeat(4, auto); }
  /* Desktop: a tighter opening so both scores, both quotes and Sam's switch fit the first screen. */
  .story .masthead h1 { margin: 1rem 0 0.4rem; }
  .story main > .shared, .story main > .outcomes { margin-top: 1.25rem; }
  .score-key { margin-bottom: 0.5rem; }
}

/* ---- the pair ---- */
.outcomes h2 { margin-bottom: 0.35rem; }
.score-key { margin: 0 0 1rem; color: var(--muted); }

.pair { display: grid; gap: 1.25rem; }
.person {
  min-width: 0;
  padding: 1rem 1.1rem 1.25rem;
  background: var(--sheet);
  border: 1px solid var(--rule);
  border-top: 3px solid var(--teal);
}
.person-switched { border-top-color: var(--plum); }
.person h3 { font-size: 1.625rem; margin: 0 0 0.6rem; }

.profile-label { margin: 0; font-size: 0.9375rem; font-weight: 600; }
.profile { margin: 0.35rem 0 0; font-size: 0.9375rem; }
.profile-fixed { margin-bottom: 0.25rem; }

/* The switch sits in the second person's card, above the ending it changes. */
.switch { margin-bottom: 0.25rem; }
.switch-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 0.6rem; margin: 0; }
.tag { padding-left: 0.6rem; border-left: 1px solid var(--plum); font-size: 0.8125rem; font-weight: 600; color: var(--plum); }
.switch .choices { margin: 0.6rem 0 0.5rem; }
.switch .choice { flex: 1 1 8rem; }
.switch .small { margin: 0; }

/* Start, an arrow, week eight. The arrow is decoration; the labels carry the meaning. */
.scores { display: flex; align-items: flex-end; gap: 0 3.5rem; margin: 1.1rem 0 0.9rem; }
.scores div { position: relative; }
.scores dt { font-size: 0.8125rem; }
.scores dd { font: 600 clamp(2.75rem, 2rem + 4vw, 3.75rem)/1 var(--serif); font-variant-numeric: lining-nums tabular-nums; }
.scores div:first-child dd { font-weight: 400; color: var(--muted); }
.scores div + div::before {
  content: "→";
  content: "→" / "";
  position: absolute;
  left: -2.4rem;
  bottom: 0.45rem;
  font: 400 1.5rem/1 var(--sans);
  color: var(--muted);
}

.person blockquote {
  margin: 0;
  padding-left: 0.85rem;
  border-left: 3px solid var(--rule);
  font: 400 1.1875rem/1.4 var(--serif);
}

@media (min-width: 44rem) {
  .pair { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 2rem; }
}

/* Side by side, each card's rows share one set of lines, so the two scores and the two
   descriptions sit level whichever ending is showing. Score first: the score and quote lead,
   the profile details and Sam's switch follow, so switching never moves the ending it changes. */
@supports (grid-template-rows: subgrid) {
  @media (min-width: 44rem) {
    .person { display: grid; grid-template-rows: subgrid; grid-row: span 5; align-content: start; padding-top: 0.75rem; }
    .ending { display: contents; }
    .person > h3 { grid-row: 1; margin-bottom: 0.25rem; }
    .person .scores { grid-row: 2; margin: 0.5rem 0 0.75rem; }
    .person blockquote { grid-row: 3; margin-bottom: 1rem; }
    .switch { grid-row: 4; }
    .profile-fixed { grid-row: 4 / span 2; }
    .ending > .profile { grid-row: 5; }
    .switch .choices { margin: 0.5rem 0 0.4rem; }
  }
}

/* ---- the question ---- */
.quiz { padding-top: 1.25rem; border-top: 1px solid var(--ink); }
.quiz h2 { max-width: 44rem; }
.quiz .banner { margin: 0 0 1rem; }
.quiz .choice { justify-content: center; min-width: 9rem; padding: 0.6rem 0.9rem; font-size: 1.0625rem; }

/* Empty until an answer is chosen; the words say whether it was the intended one. */
.feedback { max-width: 46rem; margin: 0; }
.feedback[data-result] {
  margin: 1rem 0 0;
  padding: 0.85rem 1rem;
  background: var(--sheet);
  border: 1px solid var(--rule);
  border-left: 4px solid var(--attention);
  font-size: 1.0625rem;
}
.feedback[data-result="intended"] { border-left-color: var(--teal); }

/* ---- where to go next ---- */
.explore { padding-top: 1.25rem; border-top: 1px solid var(--ink); }
.explore > p { max-width: 46rem; }
.destinations { display: grid; gap: 0 2rem; margin: 1.25rem 0 0; padding: 0; list-style: none; }
.destinations li { padding: 0.35rem 0 0.75rem; border-top: 1px solid var(--rule); }
.destinations a { display: inline-flex; align-items: center; min-height: 44px; font: 600 1.1875rem/1.2 var(--serif); }
.destinations .small { display: block; }

@media (min-width: 44rem) {
  .destinations { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* With the reader's own colours, the card and feedback edges stay visible. */
@media (forced-colors: active) {
  .person, .feedback[data-result] { border-color: CanvasText; }
}
