/* Reader-type quiz. Base tokens, type and the tone-* classes live in site.css. */

body.quiz { transition: background-color 450ms ease, color 450ms ease; min-height: 100vh; display: flex; flex-direction: column; overflow-x: clip; }
body.quiz main { flex: 1; }
body.quiz > .wrap { width: 100%; } /* auto margins would otherwise shrink-wrap these in the flex column */
.quiz .masthead { border-color: currentColor; }
.quiz .footer { border-color: currentColor; }

/* The You gradient, for the result only. */
.tone-you { --bg: #ff8f8a; --fg: var(--ink); --head: var(--cream); --muted: var(--ink); }
.you-ground {
  position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: 0; transition: opacity 600ms ease;
  background:
    radial-gradient(ellipse 55% 45% at 20% 15%, #ffb0c8 0%, transparent 70%),
    radial-gradient(ellipse 50% 50% at 85% 30%, #ff4fa0 0%, transparent 70%),
    radial-gradient(ellipse 60% 50% at 30% 85%, #ffb347 0%, transparent 70%),
    linear-gradient(180deg, #ff8f8a, #ff7a66);
}
body.tone-you .you-ground { opacity: 1; }
body.tone-you { background: transparent; }

.quiz .pill, .quiz-embed .pill { transition: transform 160ms cubic-bezier(.23, 1, .32, 1); }
.quiz .pill:active, .quiz-embed .pill:active { transform: scale(.97); }
.quiz button.pill, .quiz-embed button.pill { border: 0; cursor: pointer; }

/* ---------- Intro ---------- */
.q-intro { padding: clamp(56px, 10vw, 120px) 0; display: grid; gap: 24px; justify-items: start; }
.q-intro .display { font-size: clamp(60px, 11vw, 150px); max-width: 11ch; }
.q-intro .kicker { color: var(--fg); }

/* ---------- Question ---------- */
.q { padding: clamp(36px, 6vw, 72px) 0 clamp(48px, 8vw, 96px); }
.q-top { display: flex; justify-content: space-between; align-items: baseline; }
.q-top .kicker { color: var(--fg); }
.q-back, .q-none, .q-share, .q-again {
  appearance: none; background: none; border: 0; padding: 0; color: inherit; cursor: pointer;
  font: 600 15px/1.3 var(--body); text-decoration: underline; text-underline-offset: .2em; text-decoration-thickness: 1.5px;
}
.q-h { font-size: clamp(44px, 7vw, 88px); margin: 18px 0 clamp(28px, 4vw, 44px); max-width: 14ch; outline: none; }

/* Covers in a grid: four across on a wide screen, three on a phone. */
.covers { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(10px, 2vw, 22px); max-width: 860px; }
@media (min-width: 760px) { .covers { grid-template-columns: repeat(4, 1fr); } }
.cover-btn {
  appearance: none; border: 0; padding: 0; background: none; cursor: pointer;
  border-radius: 6px; overflow: hidden; aspect-ratio: 2 / 3;
  box-shadow: 0 10px 24px rgba(46, 21, 34, .28);
  transition: transform 200ms cubic-bezier(.23, 1, .32, 1), box-shadow 200ms ease;
}
.cover-btn img { width: 100%; height: 100%; object-fit: cover; display: block; }
@media (hover: hover) and (pointer: fine) {
  .cover-btn:hover { transform: translateY(-6px) rotate(-1.5deg); box-shadow: 0 18px 34px rgba(46, 21, 34, .34); }
}
.cover-btn:active { transform: scale(.97); }
.cover-btn:focus-visible { outline: 3px solid currentColor; outline-offset: 4px; }

.says { display: grid; gap: 12px; max-width: 640px; }
.say {
  appearance: none; cursor: pointer; text-align: left;
  border: 2px solid currentColor; border-radius: 18px; background: transparent; color: inherit;
  padding: 18px 22px; font: 500 clamp(17px, 2vw, 20px)/1.35 var(--body);
  transition: background-color 150ms ease, transform 160ms cubic-bezier(.23, 1, .32, 1);
}
@media (hover: hover) and (pointer: fine) { .say:hover { background: rgba(255, 255, 255, .16); } }
.say:active { transform: scale(.98); }

.q-none { display: block; margin-top: 26px; }

/* ---------- Result ---------- */
.q-result { padding: clamp(36px, 6vw, 72px) 0 clamp(56px, 8vw, 96px); display: grid; gap: 36px; align-items: start; }
@media (min-width: 900px) { .q-result { grid-template-columns: 1.2fr 1fr; align-items: center; } }
.card { background: rgba(255, 241, 241, .22); border-radius: 28px; padding: clamp(26px, 4vw, 44px); }
.card .kicker { color: var(--ink); }
.q-type { font-size: clamp(54px, 8.5vw, 110px); margin: 14px 0 18px; outline: none; overflow-wrap: break-word; }
.q-line { font-size: clamp(18px, 2vw, 21px); margin: 0; max-width: 32rem; }
.q-stickers { display: flex; gap: 6px; margin: 24px 0 8px; }
.q-stickers img { width: clamp(72px, 10vw, 104px); height: auto; margin: -10px -6px; filter: var(--sticker-shadow); transform: rotate(var(--r)); }
.q-aura { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 12px; }
.q-aura li { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; align-items: baseline; }
.q-aura span { font-weight: 600; }
.q-aura b { font-family: var(--display); font-weight: 400; font-size: 26px; color: var(--cream); }
.q-aura i { grid-column: 1 / -1; display: block; height: 6px; border-radius: 3px; background: rgba(74, 31, 51, .2); position: relative; overflow: hidden; }
.q-aura i::after { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--w); background: var(--cream); border-radius: 3px; }

.q-after { display: grid; gap: 18px; justify-items: start; }
.q-club { margin: 18px 0 0; font-size: clamp(17px, 1.8vw, 19px); max-width: 32rem; }
.q-club span { font-weight: 600; }
.q-more { font-family: var(--display); font-size: clamp(34px, 4.2vw, 52px); line-height: .95; letter-spacing: -.02em; margin: 0; color: var(--cream); }
.q-more-line { margin: 0; max-width: 26rem; font-size: 17px; }
.q-links { display: flex; gap: 22px; }
.q-status { margin: 0; font-size: 15px; min-height: 1.4em; }

@media (prefers-reduced-motion: reduce) {
  body.quiz, .you-ground, .cover-btn, .say, .quiz .pill, .quiz-embed .pill { transition: none; }
}

/* ---------- Embedded on the home page ---------- */
.quiz-embed { transition: background-color 450ms ease, color 450ms ease; scroll-margin-top: 0; }
.quiz-embed > .wrap { min-height: min(100vh, 860px); display: flex; flex-direction: column; justify-content: center; }
.quiz-embed.tone-you {
  background:
    radial-gradient(ellipse 55% 45% at 20% 15%, #ffb0c8 0%, transparent 70%),
    radial-gradient(ellipse 50% 50% at 85% 30%, #ff4fa0 0%, transparent 70%),
    radial-gradient(ellipse 60% 50% at 30% 85%, #ffb347 0%, transparent 70%),
    linear-gradient(180deg, #ff8f8a, #ff7a66);
}
