/* Everything the reader touches: reader cards, inputs, topic grid, the answer card,
   the collection drawer, and toasts. */

/* ---- reader picker ---------------------------------------------------- */

.picks {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: center;
  max-width: 660px;
}

.pickwrap {
  position: relative;
}

.pick {
  width: 160px;
  padding: 22px 16px;
  border-radius: 24px;
  background: rgba(255, 253, 246, 0.04);
  border: 1px solid var(--hair);
  transition: transform 0.15s var(--ease);
}

.pick:active {
  transform: scale(0.96);
}

.pick .face {
  width: 74px;
  height: 74px;
  border-radius: 999px;
  margin: 0 auto 12px;
  display: grid;
  place-items: center;
  font-family: var(--display);
  font-weight: 800;
  font-size: 30px;
  color: var(--ink);
  background: var(--c);
}

.pick b {
  font-family: var(--display);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.02em;
  word-break: break-word;
}

.pick em {
  display: block;
  font-style: normal;
  font-family: var(--util);
  font-size: 10px;
  color: var(--dust);
  margin-top: 6px;
}

.pickwrap .x {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 32px;
  height: 32px;
  min-height: 32px;
  border-radius: 999px;
  color: var(--dust);
  font-size: 15px;
  line-height: 1;
  z-index: 1;
}

/* Navigation is done with real links so the back button, middle-click and
   screen readers all behave. They are styled as the buttons they replaced. */
a.row,
a.next,
a.topic,
a.token,
a.ghost,
a.brand {
  text-decoration: none;
}

/* .next and .token set their own ink-on-colour, so they are left alone here. */
a.row,
a.topic,
a.ghost,
a.brand {
  color: inherit;
}

a.ghost {
  display: inline-flex;
  align-items: center;
}

.pick.add {
  border-style: dashed;
  color: var(--marigold);
}

.pick.add .face {
  background: rgba(255, 194, 75, 0.15);
  color: var(--marigold);
  font-size: 34px;
}

/* ---- inputs ----------------------------------------------------------- */

.namebox,
.askbox {
  display: flex;
  gap: 8px;
  background: var(--paper);
  border-radius: 22px;
  padding: 8px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
}

.namebox {
  max-width: 440px;
  margin: 0 auto;
}

.namebox input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-family: var(--display);
  font-weight: 800;
  font-size: 22px;
  padding: 0 12px;
  min-height: 58px;
  text-align: center;
}

.namebox input::placeholder {
  color: rgba(11, 27, 51, 0.28);
  font-weight: 700;
}

.askbox input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-family: var(--body);
  font-weight: 700;
  font-size: 19px;
  padding: 0 12px;
  min-height: 56px;
}

.askbox input::placeholder {
  color: rgba(11, 27, 51, 0.32);
  font-weight: 600;
}

.go {
  min-width: 66px;
  border-radius: 16px;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--display);
  font-weight: 800;
  font-size: 20px;
}

.go:disabled {
  opacity: 0.3;
}

.go.start {
  min-height: 60px;
  padding: 0 34px;
  border-radius: 18px;
  background: var(--marigold);
  color: var(--ink);
}

.ages {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  max-width: 430px;
  margin: 0 auto;
}

.age {
  min-width: 54px;
  min-height: 54px;
  border-radius: 16px;
  border: 1px solid var(--hair);
  font-family: var(--display);
  font-weight: 700;
  font-size: 18px;
}

/* ---- topic grid ------------------------------------------------------- */

.topics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

@media (max-width: 600px) {
  .topics {
    grid-template-columns: repeat(2, 1fr);
  }
}

.topic {
  min-height: 100px;
  border-radius: 20px;
  padding: 14px;
  text-align: left;
  border: 1px solid var(--hair);
  background: rgba(255, 253, 246, 0.04);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.12s var(--ease);
}

.topic:active {
  transform: scale(0.97);
}

.topic .dot {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: var(--c);
}

.topic b {
  font-family: var(--display);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.topic small {
  display: block;
  font-family: var(--util);
  font-size: 10px;
  color: var(--dust);
  margin-top: 3px;
}

/* A hairline fill showing how much of a topic this reader has found.
   `display: block` is load-bearing on both of these: the markup uses spans, and an
   inline box ignores height, which drops the fill out of the card as a stray vertical
   bar sized by its width percentage. */
.topic .bar {
  display: block;
  width: 100%;
  height: 3px;
  border-radius: 999px;
  background: var(--hair);
  margin-top: 8px;
  overflow: hidden;
}

.topic .bar i {
  display: block;
  height: 100%;
  min-height: 0;
  border-radius: 999px;
  background: var(--c);
  transition: width 0.4s var(--ease);
}

/* Fill width in 5%-wide steps instead of an inline style, per the CSP note above. */
.topic .bar i.w-0 {
  width: 0%;
}
.topic .bar i.w-5 {
  width: 5%;
}
.topic .bar i.w-10 {
  width: 10%;
}
.topic .bar i.w-15 {
  width: 15%;
}
.topic .bar i.w-20 {
  width: 20%;
}
.topic .bar i.w-25 {
  width: 25%;
}
.topic .bar i.w-30 {
  width: 30%;
}
.topic .bar i.w-35 {
  width: 35%;
}
.topic .bar i.w-40 {
  width: 40%;
}
.topic .bar i.w-45 {
  width: 45%;
}
.topic .bar i.w-50 {
  width: 50%;
}
.topic .bar i.w-55 {
  width: 55%;
}
.topic .bar i.w-60 {
  width: 60%;
}
.topic .bar i.w-65 {
  width: 65%;
}
.topic .bar i.w-70 {
  width: 70%;
}
.topic .bar i.w-75 {
  width: 75%;
}
.topic .bar i.w-80 {
  width: 80%;
}
.topic .bar i.w-85 {
  width: 85%;
}
.topic .bar i.w-90 {
  width: 90%;
}
.topic .bar i.w-95 {
  width: 95%;
}
.topic .bar i.w-100 {
  width: 100%;
}

.surprise {
  width: 100%;
  margin-top: 12px;
  min-height: 62px;
  border-radius: 20px;
  border: 1px dashed var(--hair);
  font-family: var(--display);
  font-weight: 700;
  font-size: 18px;
  color: var(--marigold);
}

/* ---- question lists --------------------------------------------------- */

.list {
  display: grid;
  gap: 10px;
}

.row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  border-radius: 18px;
  border: 1px solid var(--hair);
  padding: 10px 16px;
  text-align: left;
  font-family: var(--body);
  font-weight: 700;
  font-size: 17px;
  background: rgba(255, 253, 246, 0.03);
}

.row:active {
  background: rgba(255, 253, 246, 0.08);
}

.row .dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  flex: 0 0 auto;
  background: var(--c);
}

.row .tick {
  margin-left: auto;
  color: var(--dust);
  font-size: 13px;
  flex: 0 0 auto;
}

/* ---- the answer card -------------------------------------------------- */

.card {
  background: var(--paper);
  color: var(--ink);
  border-radius: 28px;
  padding: 26px 22px 22px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
  animation: rise 0.28s var(--ease) both;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.cardhead {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.stamp {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--util);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 7px 12px;
  border-radius: 999px;
  color: var(--ink);
  font-weight: 700;
  background: var(--c);
}

.card h2 {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(26px, 4.6vw, 40px);
  line-height: 1.02;
  letter-spacing: -0.035em;
  margin: 14px 0 10px;
}

.hook {
  font-size: 19px;
  font-weight: 700;
  margin: 0 0 18px;
  color: var(--ink-hook);
}

p.txt {
  font-size: 18px;
  line-height: 1.62;
  margin: 0 0 14px;
  color: var(--ink-body);
}

.box {
  border-radius: 18px;
  padding: 15px 18px;
  margin-top: 16px;
}

.box.tip {
  background: color-mix(in srgb, var(--c) 13%, transparent);
}

.box.wow {
  background: rgba(11, 27, 51, 0.06);
}

.box .eyebrow {
  color: var(--ink-soft);
}

.box p {
  margin: 6px 0 0;
  font-size: 17px;
  line-height: 1.5;
  font-weight: 600;
}

/* Reading-level switch. Only rendered when an entry has more than one version. */
.levels {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border-radius: 999px;
  background: rgba(11, 27, 51, 0.06);
  flex: 0 0 auto;
}

.levels button {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  font-family: var(--util);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--ink-soft);
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}

.levels button[aria-pressed="true"] {
  background: var(--ink);
  color: var(--paper);
}

.nexts {
  display: grid;
  gap: 10px;
  margin-top: 22px;
}

.next {
  min-height: 58px;
  border-radius: 16px;
  border: 1px solid var(--ink-hair);
  text-align: left;
  padding: 8px 16px;
  font-family: var(--body);
  font-weight: 700;
  font-size: 17px;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 10px;
}

.next:active {
  background: rgba(11, 27, 51, 0.05);
}

.next i {
  font-style: normal;
  font-family: var(--util);
  font-size: 11px;
  color: rgba(11, 27, 51, 0.4);
  flex: 0 0 auto;
}

.ghost {
  min-height: 52px;
  padding: 0 20px;
  border-radius: 16px;
  border: 1px solid var(--hair);
  font-family: var(--display);
  font-weight: 700;
  font-size: 16px;
}

/* ---- the collection drawer -------------------------------------------- */

.drawer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(7, 20, 38, 0.94);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--hair);
  padding: 10px 16px calc(12px + env(safe-area-inset-bottom));
}

.drawer .head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  gap: 10px;
}

.count {
  font-family: var(--util);
  font-size: 11px;
  color: var(--dust);
}

.count b {
  color: var(--paper);
  font-size: 13px;
}

.rail {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.rail::-webkit-scrollbar {
  display: none;
}

.token {
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-family: var(--util);
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
  background: var(--c);
  animation: pop 0.3s var(--ease) both;
}

@keyframes pop {
  from {
    transform: scale(0.4) rotate(-10deg);
    opacity: 0;
  }
  to {
    transform: none;
    opacity: 1;
  }
}

.empty {
  font-family: var(--util);
  font-size: 11px;
  color: var(--dust);
  padding: 14px 0;
  margin: 0;
}

.empty.center {
  text-align: center;
}

/* ---- toast ------------------------------------------------------------ */

.toast {
  position: fixed;
  left: 50%;
  top: 18px;
  transform: translateX(-50%);
  background: var(--marigold);
  color: var(--ink);
  font-family: var(--display);
  font-weight: 800;
  padding: 12px 20px;
  border-radius: 999px;
  z-index: 9;
  animation: rise 0.3s var(--ease) both;
}

/* ---- feedback ---------------------------------------------------------- */

/* The "tell us" lines. Quiet and last on their screens — feedback is offered,
   never begged for. */
.feedback {
  margin: 26px 0 10px;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--dust);
  text-align: center;
}

.feedback a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* A button dressed as a link, because it acts on the clipboard, not the URL. */
.copymail {
  border: 0;
  padding: 0;
  background: none;
  font: inherit;
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

/* Offstage textarea for the execCommand copy fallback. It has to be in the
   document and selectable — display: none would break the selection — so it is
   merely invisible. */
.copystage {
  position: fixed;
  top: 0;
  left: 0;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
