/* The first questions on the open book (questions.js): the question on the left page, the answers on the right, a
   leaf turning over the spine between them; on a phone one page, the question above its answers */
.q-book {
  position: relative;
  perspective: 2400px;
}
/* The pages' margins grow with the book (its width: cqi, app.css .ways-book), not the window, so its words and answers
   keep the air a printed page has round them at any size */
.q-page {
  display: grid;
  align-content: center;
  gap: 14px;
  min-width: 0;
  padding: clamp(20px, 5.4cqi, 60px);
}
.q-ask {
  padding-right: clamp(24px, 6.6cqi, 72px);
}
.q-title {
  margin: 0;
  max-width: 11ch;
  font:
    400 clamp(26px, 4.6vmin, 46px) / 1.06 'Fraunces',
    Georgia,
    serif;
  letter-spacing: -0.015em;
  text-wrap: balance;
}
.q-sub {
  margin: 0;
  max-width: 30ch;
  color: var(--quiet);
  font-size: clamp(14px, 1.8vmin, 16px);
  line-height: 1.45;
}

/* ---- an answer: a small drawing in the book's hand and its words */
.q-answers {
  gap: 2px;
}
.q-answer {
  display: grid;
  grid-template-columns: clamp(34px, 5.4vmin, 48px) 1fr;
  align-items: center;
  gap: 12px;
  padding: 6px 12px 6px 8px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--text);
  text-align: left;
  transition:
    background 0.2s,
    transform 0.25s var(--ease);
}
.q-answer:hover,
.q-answer:focus-visible {
  background: rgb(36 34 31 / 0.05);
}
.q-answer:active {
  transform: scale(0.98);
}
.q-answer[aria-pressed='true'] {
  background: rgb(36 34 31 / 0.07);
}
.q-drawn {
  display: block;
  aspect-ratio: 1;
  transition: transform 0.35s var(--ease);
}
.q-drawn svg {
  display: block;
  width: 100%;
  height: 100%;
}
.q-answer:hover .q-drawn {
  transform: rotate(-7deg) scale(1.08);
}
.q-words b {
  display: block;
  font-size: clamp(15px, 2vmin, 17px);
  font-weight: 600;
}
.q-words small {
  display: block;
  color: var(--quiet);
  font-size: clamp(12.5px, 1.6vmin, 14px);
  line-height: 1.35;
}
/* 'Iets anders' apart under the kinds: a short rule over it, a smaller drawing and quieter words, the way out for a
   book of no kind rather than one more kind in the list */
.q-answer.q-other {
  position: relative;
  margin-top: clamp(10px, 1.8vmin, 16px);
  grid-template-columns: clamp(26px, 4vmin, 34px) 1fr;
  column-gap: 10px;
  padding-left: calc(8px + (clamp(34px, 5.4vmin, 48px) - clamp(26px, 4vmin, 34px)) / 2);
}
.q-answer.q-other::before {
  content: '';
  position: absolute;
  top: calc(clamp(10px, 1.8vmin, 16px) / -2 - 1px);
  left: 12px;
  width: 48px;
  border-top: 1.5px solid var(--line);
}
.q-other .q-words b {
  font-weight: 500;
  color: var(--quiet);
}
.q-other:hover .q-words b,
.q-other:focus-visible .q-words b,
.q-other[aria-pressed='true'] .q-words b {
  color: var(--text);
}

/* the two answers about the AI: cards, each saying in a line what it means */
.q-seeing {
  gap: 12px;
}
.q-choice {
  grid-template-columns: clamp(44px, 7vmin, 64px) 1fr;
  gap: 14px;
  padding: clamp(12px, 2vmin, 18px);
  border: 1.5px solid var(--line);
  border-radius: 16px;
  background: rgb(255 255 255 / 0.55);
}
.q-choice:hover,
.q-choice:focus-visible {
  border-color: rgb(36 34 31 / 0.3);
  background: #fff;
}
.q-choice[aria-pressed='true'] {
  border-color: var(--accent);
  background: #fff;
}
.q-choice small {
  margin-top: 3px;
  color: var(--text);
  opacity: 0.78;
}

/* a few words, written on the page's own lines */
.q-told {
  width: 100%;
  min-height: calc(4 * 1.45em);
  padding: 0 2px;
  border: 0;
  outline: none;
  resize: none;
  background: repeating-linear-gradient(transparent 0 calc(1.45em - 1px), rgb(36 34 31 / 0.16) 0 1.45em);
  color: var(--text);
  font:
    500 clamp(21px, 3vmin, 26px) / 1.45 'Caveat',
    cursive;
}
.q-told::placeholder {
  color: rgb(36 34 31 / 0.38);
}
.q-row {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 14px;
}
.q-skip {
  padding: 6px;
  border: 0;
  background: none;
  color: var(--quiet);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* the kind's follow-up: each field its small label over a line typed on the page, a date, or a few picks */
.q-follow {
  gap: clamp(14px, 2.4vmin, 22px);
}
.q-field {
  display: grid;
  gap: 4px;
  min-width: 0;
}
.q-label {
  color: var(--quiet);
  font-size: clamp(12.5px, 1.6vmin, 14px);
  font-weight: 600;
}
.q-line {
  width: 100%;
  min-width: 0;
  height: 1.45em;
  padding: 0 2px;
  border: 0;
  border-bottom: 1px solid rgb(36 34 31 / 0.22);
  border-radius: 0;
  outline: none;
  background: none;
  color: var(--text);
  font:
    500 clamp(21px, 3vmin, 26px) / 1.45 'Caveat',
    cursive;
  transition: border-color 0.2s;
}
.q-line:focus {
  border-bottom-color: var(--accent);
}
.q-line::placeholder {
  color: rgb(36 34 31 / 0.38);
}
/* an empty date shows the device's day-month-year in the hint's ink, a chosen one in the pen's */
.q-line.is-empty {
  color: rgb(36 34 31 / 0.38);
}
.q-line::-webkit-calendar-picker-indicator {
  opacity: 0.45;
  cursor: pointer;
}
.q-picks {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-top: 2px;
}
.q-pick {
  min-height: 36px;
  padding: 0 14px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: rgb(255 255 255 / 0.55);
  color: var(--text);
  font-weight: 500;
  transition:
    border-color 0.2s,
    background 0.2s,
    transform 0.25s var(--ease);
}
.q-pick:hover,
.q-pick:focus-visible {
  border-color: rgb(36 34 31 / 0.3);
  background: #fff;
}
.q-pick:active {
  transform: scale(0.96);
}
.q-pick[aria-pressed='true'] {
  border-color: var(--accent);
  background: #fff;
}

/* ---- the leaf turning over the spine, the page under it until it covers that */
.q-leaf,
.q-under {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 50%;
  pointer-events: none;
}
.q-under {
  z-index: 2;
  display: grid;
  background: linear-gradient(180deg, #fdfaf4, #f6f1e7);
}
.q-under.is-left {
  left: 0;
}
.q-leaf {
  z-index: 3;
  transform-origin: left center;
  transform-style: preserve-3d;
}
.q-leaf.is-back {
  left: 0;
  transform-origin: right center;
}
.q-face {
  position: absolute;
  inset: 0;
  display: grid;
  backface-visibility: hidden;
  background: linear-gradient(180deg, #fdfaf4, #f6f1e7);
  box-shadow: 0 0 30px -10px rgb(40 30 20 / 0.35);
}
.q-face-back {
  transform: rotateY(180deg);
}

/* ---- under the book: the question before, and the way without photos */
.ways-under {
  display: grid;
  justify-items: center;
  gap: 14px;
}
.ways-row {
  display: flex;
  align-items: center;
  gap: 18px;
}
.ways-row:not(:has(> :not([hidden]))) {
  display: none;
}
/* the step back reads as going back: an arrow and plain words, never underlined like a link that does something */
.ways-back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 40px;
  padding: 0 12px 0 6px;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--quiet);
  font-weight: 500;
  transition:
    color 0.2s,
    background 0.2s;
}
.ways-back:hover {
  background: rgb(36 34 31 / 0.06);
  color: var(--text);
}
.ways-back svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.25s var(--ease);
}
.ways-back:hover svg {
  transform: translateX(-3px);
}

/* on a phone, or any window as narrow, the book is one page: the question above its answers (ways.js phoneLayout).
   A page taller than the window (six answers on a short phone) starts at the top and scrolls, never centred with its
   question cut off above the screen */
.ways.on-phone {
  place-content: safe center;
  overflow-y: auto;
  padding-top: calc(var(--safe-top) + 12px);
}
.ways.on-phone .q-book {
  grid-template-rows: auto auto;
  width: min(90vw, 420px);
  aspect-ratio: auto;
}
.ways.on-phone .q-ask {
  padding-bottom: 0;
}
.ways.on-phone .q-answers {
  align-content: start;
}
/* a finger's answers: a full row each, tall enough to tap without aiming */
.ways.on-phone .q-answer {
  min-height: 52px;
  padding: 8px 12px 8px 6px;
}

/* a short screen (a phone held sideways): what's under the book in one row, so the book keeps its height (two, where
   the dock's column leaves the row too little width) */
@media (max-height: 500px) {
  .ways-under {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
  }
}

/* the AI's answer is advised: a small label over its words */
.q-badge {
  display: block;
  width: fit-content;
  margin-bottom: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
}
/* what happens to the photos when the AI looks: three short lines with a small tick, then the privacy page */
.q-promises {
  display: grid;
  gap: 6px;
  max-width: 32ch;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
  color: var(--text);
  font-size: clamp(13px, 1.7vmin, 15px);
  line-height: 1.4;
}
.q-promises li {
  position: relative;
  padding-left: 22px;
}
.q-promises li::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 0.35em;
  width: 10px;
  height: 5px;
  border: solid var(--accent);
  border-width: 0 0 2px 2px;
  transform: rotate(-45deg);
}
.q-privacy {
  display: inline-block;
  margin-top: 12px;
  color: var(--quiet);
  font-size: clamp(12.5px, 1.6vmin, 14px);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.q-privacy:hover {
  color: var(--text);
}

/* "Nee" asked once more (questions.js askSure), in the app's modal: the wand, a short title, three lines, then both
   answers alike in size and weight */
.q-sure .q-drawn {
  display: block;
  width: 52px;
  margin-bottom: 10px;
}
.q-sure .sheet-title {
  margin: 0 0 10px;
  line-height: 1.25;
}
.q-sure p {
  margin: 0 0 10px;
  font-size: 15px;
  line-height: 1.45;
}
.q-sure .q-sure-free {
  color: var(--quiet);
}
.q-sure-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 18px;
}
.q-sure-row .chip {
  justify-content: center;
  min-height: 46px;
  padding: 0 12px;
  white-space: normal;
  text-align: center;
}
