:root {
  --type: #242323;
  --red: #993626;
  --pale: #f5e4d7;
  --paper: #fffcf5;
  font: 16px/1.53 Arial, "Trebuchet MS", sans-serif;
  color: var(--type);
  background: var(--paper);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
}

.sheet, .keypage {
  width: min(91%,88rem);
  margin: 0 auto;
  padding: 1.1rem 0 1.8rem;
}

a {
  color: var(--red);
  text-decoration-thickness: .075em;
  text-underline-offset: .22em;
}

a:hover {
  color: #52221a;
}

:focus-visible {
  outline: 3px solid #6b412e;
  outline-offset: 3px;
}

.book-title {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: baseline;
  gap: 1.1rem;
  padding: .5rem 0 1rem;
  border-bottom: 5px solid var(--red);
}

.colophon {
  width: max-content;
  color: var(--red);
  font-weight: 900;
  letter-spacing: -.08em;
}

.book-title h1 {
  font-size: clamp(1.05rem,2vw,1.52rem);
  letter-spacing: -.04em;
  font-weight: 550;
  margin: 0;
}

.book-title a {
  font-size: .88rem;
  font-weight: 700;
}

.page-spread {
  display: grid;
  grid-template-columns: minmax(0,1.05fr) minmax(0,1fr);
  align-items: stretch;
  min-height: clamp(29rem,62vh,42rem);
}

.inquiry {
  padding: clamp(2.5rem,5vw,5rem) 2rem 2rem 0;
}

.breadcrumb {
  font-size: .84rem;
  color: #7b392c;
  letter-spacing: .025em;
  margin: 0 0 2.4rem;
}

.inquiry h2 {
  font-size: clamp(3.2rem,7.8vw,7.9rem);
  line-height: .92;
  font-weight: 700;
  letter-spacing: -.085em;
  margin: 0 0 1.4rem;
  max-width: 9.2ch;
  overflow-wrap: break-word;
}

#prompt {
  max-width: 31rem;
  font-size: clamp(1rem,1.3vw,1.21rem);
  line-height: 1.48;
  margin: 0;
}

.junction {
  display: grid;
  grid-template-columns: clamp(1.4rem,4vw,5rem) minmax(0,1fr);
  align-self: center;
}

.joiner {
  position: relative;
}

.joiner::after {
  content: '';
  position: absolute;
  top: 50%;
  left: -.1rem;
  right: 0;
  height: 3px;
  background: var(--red);
}

.joiner::before {
  content: '';
  position: absolute;
  top: calc(50% - .28rem);
  left: -.1rem;
  height: .7rem;
  width: .7rem;
  background: var(--red);
  border-radius: 50%;
}

.options {
  display: grid;
}

.branch {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 1.2rem .55rem 1.2rem clamp(2rem,5.2vw,5.5rem);
  min-height: 9.3rem;
  justify-content: center;
  font: inherit;
  text-align: left;
  color: var(--type);
  background: transparent;
  border: 0;
  cursor: pointer;
}

.branch::before {
  content: '';
  position: absolute;
  left: 0;
  width: calc(clamp(2rem,5.2vw,5.5rem) - .65rem);
  height: 50%;
  border-left: 3px solid var(--red);
}

.branch:first-child::before {
  top: 50%;
  border-top: 3px solid var(--red);
  border-top-left-radius: 1rem;
}

.branch:last-child::before {
  bottom: 50%;
  border-bottom: 3px solid var(--red);
  border-bottom-left-radius: 1rem;
}

.branch > span {
  width: fit-content;
  color: var(--red);
  font-size: clamp(1.6rem,3.8vw,3.6rem);
  font-weight: 650;
  letter-spacing: -.065em;
  line-height: 1.08;
  border-bottom: .07em solid currentColor;
  padding-bottom: .05em;
}

.branch small {
  max-width: 23rem;
  margin-top: .55rem;
  font-size: .98rem;
  line-height: 1.38;
}

.branch:hover > span {
  background: var(--pale);
}

.recommendation {
  align-self: center;
  border-left: 3px solid var(--red);
  padding: 0 0 .4rem 1.75rem;
  position: relative;
}

.end-dot {
  width: .8rem;
  height: .8rem;
  border-radius: 50%;
  background: var(--red);
  position: absolute;
  top: -.1rem;
  left: -.47rem;
}

.recommendation p {
  max-width: 34rem;
  margin: 0 0 .95rem;
}

.recommendation > p:first-of-type {
  font-size: .78rem;
  color: var(--red);
  text-transform: uppercase;
  letter-spacing: .12em;
}

.recommendation h3 {
  font: 700 clamp(2rem,4.7vw,5rem)/1 Arial,sans-serif;
  margin: .4rem 0 1rem;
  letter-spacing: -.07em;
}

.recommendation a {
  font-weight: bold;
}

.page-controls {
  border-top: 1px solid #715c53;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .6rem;
  padding: .85rem 0;
}

.return-controls {
  display: flex;
  gap: .5rem;
}

.return-controls button {
  background: transparent;
  color: var(--red);
  border: 1px solid #bca69a;
  padding: .55rem .65rem;
  cursor: pointer;
  font: 600 .85rem/1.25 Arial,sans-serif;
}

.return-controls button:hover {
  background: var(--pale);
}

.folio-path {
  margin: 0 0 0 auto;
  font-size: .85rem;
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  color: #675a53;
  font-size: .78rem;
  padding: 1.1rem 0;
}

.keypage {
  max-width: 68rem;
}

.keypage header {
  display: flex;
  justify-content: space-between;
  padding-bottom: .65rem;
  border-bottom: 5px solid var(--red);
}

.keypage header a {
  font-size: .9rem;
}

.keypage h1 {
  font-size: clamp(2.65rem,6.1vw,6.1rem);
  line-height: .96;
  letter-spacing: -.075em;
  max-width: 14ch;
  margin: 2rem 0 .9rem;
}

.keypage article > p {
  max-width: 48rem;
  font-size: 1.1rem;
}

.keypage table {
  text-align: left;
  border-collapse: collapse;
  width: 100%;
  margin: 2rem 0 1rem;
}

.keypage th, .keypage td {
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid #b5aaa1;
  padding: .7rem .4rem .7rem 0;
}

.keypage thead {
  color: var(--red);
}

.paths {
  margin: 1.8rem 0;
}

.paths section {
  display: grid;
  grid-template-columns: minmax(9rem,1fr) minmax(0,2fr);
  gap: 1rem;
  align-items: baseline;
  padding: .8rem 0;
  border-top: 1px solid #b5aaa1;
}

.paths h2 {
  font-size: clamp(1.3rem,2.4vw,2rem);
  line-height: 1.12;
  color: var(--red);
  letter-spacing: -.04em;
  margin: 0;
}

.paths p {
  margin: 0;
}

@media (max-width: 680px) {
  .sheet, .keypage {
    width: 90%;
  }
  .book-title {
    grid-template-columns: 1fr auto;
    gap: .22rem .5rem;
    align-items: end;
  }
  .book-title h1 {
    grid-column: 1;
    grid-row: 2;
  }
  .book-title a {
    grid-column: 2;
    grid-row: 1 / span 2;
  }
  .page-spread {
    display: block;
    min-height: 0;
  }
  .inquiry {
    padding: 1.35rem 0 .6rem;
  }
  .breadcrumb {
    margin: 0 0 .95rem;
  }
  .inquiry h2 {
    font-size: clamp(3.3rem,12.7vw,5.2rem);
    max-width: 12ch;
    margin-bottom: .8rem;
  }
  .junction {
    grid-template-columns: .85rem minmax(0,1fr);
    margin: .7rem 0 1.1rem;
  }
  .branch {
    min-height: 6rem;
    padding-block: .6rem;
  }
  .branch > span {
    font-size: clamp(1.6rem,7.2vw,2.8rem);
  }
  .branch small {
    margin-top: .3rem;
    font-size: .92rem;
  }
  .recommendation {
    margin: 1.25rem 0 1.45rem .3rem;
    padding-left: 1.1rem;
  }
  .keypage table {
    font-size: .85rem;
  }
  .paths section {
    display: block;
  }
  .paths p {
    margin-top: .35rem;
  }
}
