/* Wrong Answers Only — a ruled notebook sheet, graded in red pen. */

:root {
  --desk: #efe8da;
  --paper: #fffdf6;
  --ink: #1f1d1a;
  --ink-soft: #5d574d;
  --ink-faint: #8a8375;
  --rule: rgba(64, 120, 180, 0.13);
  --margin-line: rgba(214, 72, 60, 0.4);
  --red: #c4362b;
  --red-ink: #fffdf6;
  --green: #2f8a57;
  --green-ink: #ffffff;
  --yellow: #f1c44f;
  --yellow-ink: #1f1d1a;
  --blue: #3f74b8;
  --blue-ink: #ffffff;
  --blank: #e6e0d3;
  --blank-ink: #6b6559;
  --highlight: rgba(241, 196, 79, 0.38);
  --shadow: 0 1px 0 rgba(0, 0, 0, 0.04), 0 14px 40px -18px rgba(60, 40, 10, 0.35);

  --font-display: 'Fraunces', 'Iowan Old Style', Georgia, serif;
  --font-body: 'Figtree', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-hand: 'Caveat', 'Bradley Hand', 'Segoe Print', cursive;
  --line: 32px;
  --gutter: 16px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --desk: #14171c;
    --paper: #1c2028;
    --ink: #efe9dd;
    --ink-soft: #b7b0a3;
    --ink-faint: #8c8679;
    --rule: rgba(130, 170, 220, 0.1);
    --margin-line: rgba(255, 120, 105, 0.35);
    --red: #ff7b6b;
    --red-ink: #1c2028;
    --green: #4cc07f;
    --green-ink: #10251a;
    --yellow: #f3c95c;
    --yellow-ink: #1f1d1a;
    --blue: #6fa3e6;
    --blue-ink: #10203a;
    --blank: #2c313b;
    --blank-ink: #a49d90;
    --highlight: rgba(243, 201, 92, 0.18);
    --shadow: 0 18px 50px -20px rgba(0, 0, 0, 0.7);
    color-scheme: dark;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--desk);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.page {
  max-width: 560px;
  margin: 0 auto;
  padding: max(12px, env(safe-area-inset-top)) var(--gutter) max(24px, env(safe-area-inset-bottom));
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

:focus-visible {
  outline: 3px solid var(--red);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ------------------------------------------------------------ masthead */

.masthead {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 2px 14px;
}

.wordmark {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 21px;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}

.wordmark-wrong {
  position: relative;
  color: var(--red);
  font-style: italic;
  font-weight: 700;
}

/* A quick pen squiggle under "Wrong". */
.wordmark-wrong::after {
  content: '';
  position: absolute;
  left: -2px;
  right: -2px;
  bottom: -5px;
  height: 7px;
  background: no-repeat center / 100% 100%
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 8' preserveAspectRatio='none'%3E%3Cpath d='M1 5 Q 12 1 25 4.5 T 50 4 T 75 4.5 T 99 3' fill='none' stroke='%23c4362b' stroke-width='2.2' stroke-linecap='round'/%3E%3C/svg%3E");
}

.dateline {
  margin: 0;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-soft);
  text-align: right;
}

/* ------------------------------------------------------------ the sheet */

.sheet {
  position: relative;
  min-height: 420px;
  padding: 28px 22px 32px 46px;
  background-color: var(--paper);
  background-image:
    linear-gradient(90deg, transparent 33px, var(--margin-line) 33px, var(--margin-line) 35px, transparent 35px),
    repeating-linear-gradient(180deg, transparent 0 calc(var(--line) - 1px), var(--rule) calc(var(--line) - 1px) var(--line));
  background-position: 0 0, 0 18px;
  border-radius: 6px;
  box-shadow: var(--shadow);
  outline: none;
}

@media (min-width: 520px) {
  .sheet {
    padding: 36px 36px 40px 72px;
    background-image:
      linear-gradient(90deg, transparent 51px, var(--margin-line) 51px, var(--margin-line) 53px, transparent 53px),
      repeating-linear-gradient(180deg, transparent 0 calc(var(--line) - 1px), var(--rule) calc(var(--line) - 1px) var(--line));
  }

  /* Binder holes. */
  .sheet::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 16px;
    width: 18px;
    background: radial-gradient(circle at 9px 9px, var(--desk) 7px, transparent 7.5px) 0 50% / 18px 33% repeat-y;
    opacity: 0.9;
  }
}

/* ------------------------------------------------------------ type */

h1,
h2,
p {
  margin: 0;
}

.scrawl {
  font-family: var(--font-hand);
  font-weight: 700;
  font-size: 22px;
  line-height: 1;
  color: var(--red);
}

.scrawl--tilt {
  display: inline-block;
  transform: rotate(-3deg);
  font-size: 27px;
  margin-bottom: 10px;
}

.scrawl--good {
  color: var(--green);
}

.scrawl--ok {
  color: #b5860f;
}

@media (prefers-color-scheme: dark) {
  .scrawl--ok {
    color: var(--yellow);
  }
}

.lede {
  font-size: 18px;
  color: var(--ink-soft);
  margin-top: 12px;
}

.fineprint {
  margin-top: 14px;
  font-size: 13px;
  color: var(--ink-faint);
}

.section-label,
.category,
.truth-label,
.answer-label {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

/* ------------------------------------------------------------ buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 50px;
  padding: 12px 22px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  font: 700 17px/1 var(--font-body);
  cursor: pointer;
  box-shadow: 0 3px 0 var(--ink);
  transition: transform 0.08s ease, box-shadow 0.08s ease;
  -webkit-tap-highlight-color: transparent;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 0 var(--ink);
}

.btn:active {
  transform: translateY(3px);
  box-shadow: 0 0 0 var(--ink);
}

.btn--primary {
  background: var(--red);
  border-color: var(--ink);
  color: var(--red-ink);
}

.btn--big {
  width: 100%;
  min-height: 58px;
  font-size: 19px;
  margin-top: 26px;
}

/* ------------------------------------------------------------ tiles */

.tile {
  display: inline-grid;
  place-items: center;
  flex: none;
  min-width: 40px;
  padding: 0 4px;
  height: 34px;
  border-radius: 7px;
  font: 800 14px/1 var(--font-body);
  background: var(--blank);
  color: var(--blank-ink);
}

.tile--green {
  background: var(--green);
  color: var(--green-ink);
}

.tile--yellow {
  background: var(--yellow);
  color: var(--yellow-ink);
}

.tile--blue {
  background: var(--blue);
  color: var(--blue-ink);
}

.tile--red {
  background: var(--red);
  color: var(--red-ink);
}

/* ------------------------------------------------------------ intro */

.intro-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(32px, 8.5vw, 44px);
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.intro-title em {
  font-style: italic;
  font-weight: 700;
  color: var(--red);
}

.example {
  margin: 24px 0 0;
  padding: 16px 18px;
  border: 2px dashed color-mix(in srgb, var(--ink) 22%, transparent);
  border-radius: 12px;
  transform: rotate(-0.6deg);
}

.example-q {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 600;
  font-size: 18px;
  margin-bottom: 8px;
}

.example-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}

.example-list li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  font-weight: 600;
}

.example-answer {
  position: relative;
}

.example-answer.is-struck {
  color: var(--ink-faint);
  text-decoration: line-through;
  text-decoration-color: var(--red);
  text-decoration-thickness: 2px;
}

.example-answer.is-circled::before,
.circled::before {
  content: '';
  position: absolute;
  inset: -5px -10px -4px -9px;
  border: 2px solid var(--red);
  border-radius: 52% 48% 55% 45% / 60% 50% 50% 40%;
  transform: rotate(-2deg);
  pointer-events: none;
}

.example-answer.is-circled::before {
  border-color: var(--green);
}

.legend {
  list-style: none;
  margin: 22px 0 0;
  padding: 0;
  display: grid;
  gap: 10px;
  font-size: 16px;
}

.legend li {
  display: flex;
  align-items: center;
  gap: 12px;
}

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

.round-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.round-count {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-soft);
}

.pips {
  display: inline-flex;
  gap: 5px;
}

.pip {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  border: 2px solid var(--ink-faint);
}

.pip--current {
  border-color: var(--ink);
  background: var(--ink);
}

.pip--green {
  border-color: var(--green);
  background: var(--green);
}

.pip--yellow {
  border-color: var(--yellow);
  background: var(--yellow);
}

.pip--blue {
  border-color: var(--blue);
  background: var(--blue);
}

.pip--red {
  border-color: var(--red);
  background: var(--red);
}

.pip--blank {
  border-color: var(--blank-ink);
  background: var(--blank);
}

.clock {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 30px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  min-width: 2.4ch;
  text-align: right;
  transition: color 0.3s ease;
}

.clock small {
  font-size: 16px;
  margin-left: 1px;
  color: var(--ink-faint);
}

.clock.is-urgent {
  color: var(--red);
}

/* The burning fuse: a pencil line that shortens. */
.fuse {
  height: 6px;
  margin: 12px 0 26px;
  border-radius: 99px;
  background: color-mix(in srgb, var(--ink) 9%, transparent);
  overflow: hidden;
}

.fuse span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--ink);
  transform-origin: left center;
  transition: transform 0.2s linear, background-color 0.3s ease;
}

.fuse.is-urgent span {
  background: var(--red);
}

.q-art {
  margin: -6px 0 10px -8px;
}

.q-art img {
  display: block;
  width: min(100%, 280px);
  height: auto;
}

.q-art--small img {
  width: 150px;
}

@media (prefers-color-scheme: dark) {
  /* Ink drawings need a light chip to read in dark mode; keep it muted so
     the question, not the picture, is the brightest thing on the page. */
  .q-art img {
    background: #d9d2c3;
    border-radius: 10px;
    padding: 4px;
    opacity: 0.86;
  }
}

/* Laptops: the sheet is narrow but the screen is short, so long prompts
   plus a picture could push the answer box below the fold mid-timer. */
@media (min-width: 520px) {
  .prompt {
    font-size: 32px;
  }

  .q-art img {
    width: 210px;
  }
}

@media (min-width: 520px) and (max-height: 860px) {
  .q-art img {
    width: 170px;
  }

  .q-art {
    margin-bottom: 4px;
  }

  .fuse {
    margin: 10px 0 16px;
  }

  .answer-form {
    margin-top: 18px;
  }

  .sheet {
    padding-top: 24px;
  }
}

.prompt {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(28px, 7.4vw, 38px);
  line-height: 1.12;
  letter-spacing: -0.015em;
  margin-top: 6px;
  text-wrap: balance;
}

.prompt--small {
  font-size: 20px;
  line-height: 1.25;
  margin-top: 14px;
  color: var(--ink-soft);
  font-weight: 600;
}

.answer-form {
  margin-top: 30px;
  display: grid;
  gap: 8px;
}

.answer-input {
  width: 100%;
  padding: 6px 2px 8px;
  border: 0;
  border-bottom: 3px solid var(--ink);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font: 600 26px/1.2 var(--font-body);
  caret-color: var(--red);
}

.answer-input:focus {
  outline: none;
  border-bottom-color: var(--red);
}

.answer-input[aria-invalid='true'] {
  border-bottom-color: var(--red);
}

.answer-hint {
  font-size: 14px;
  color: var(--ink-faint);
  min-height: 1.5em;
}

.answer-hint.is-error {
  color: var(--red);
  font-weight: 600;
}

.answer-form .btn {
  margin-top: 12px;
  justify-self: start;
  min-width: 170px;
}

/* ------------------------------------------------------------ reveal */

.verdict {
  display: flex;
  align-items: center;
  gap: 18px;
  margin: 22px 0 26px;
}

.stamp {
  flex: none;
  display: grid;
  place-items: center;
  width: 78px;
  height: 78px;
  border-radius: 50%;
  font: 800 21px/1 var(--font-display);
  letter-spacing: -0.02em;
  border: 3px solid currentColor;
  color: var(--blank-ink);
  position: relative;
  font-variant-numeric: tabular-nums;
  transform: rotate(-8deg);
}

.stamp-x {
  position: absolute;
  inset: -6px;
  overflow: visible;
}

.stamp-x path {
  fill: none;
  stroke: var(--red);
  stroke-width: 6;
  stroke-linecap: round;
  stroke-dasharray: 160;
  stroke-dashoffset: 0;
  opacity: 0.4;
}

/* ---- result animations (only right after answering) ---- */

.is-fresh .stamp {
  animation: stamp 0.42s cubic-bezier(0.2, 1.4, 0.4, 1) both;
}

.reveal--top.is-fresh .stamp {
  animation: slam 0.55s cubic-bezier(0.2, 1.6, 0.35, 1) both;
}

.reveal--top.is-fresh .verdict-title {
  animation: cheer 0.6s 0.25s ease-out both;
}

.reveal--high.is-fresh .stamp {
  animation: bounce 0.8s ease-out both;
}

.reveal--mid.is-fresh .stamp {
  animation: wobble 0.8s ease-out both;
}

.reveal--wrong.is-fresh .stamp,
.reveal--other.is-fresh .stamp,
.reveal--timeout.is-fresh .stamp {
  animation: shrug 0.7s ease-out both;
}

.reveal--correct.is-fresh .verdict {
  animation: shake 0.5s 0.35s ease-in-out both;
}

.reveal--correct.is-fresh .stamp-x path {
  animation: scribble 0.45s 0.3s ease-out both;
}

.is-fresh .crowd-row.is-mine {
  animation: glow 1.4s 0.5s ease-out both;
}

.results.is-fresh .score-tiles .tile {
  animation: flip 0.45s ease-out both;
}

.results.is-fresh .score-tiles .tile:nth-child(2) {
  animation-delay: 0.25s;
}

.results.is-fresh .score-tiles .tile:nth-child(3) {
  animation-delay: 0.5s;
}

.verdict {
  position: relative;
}

.confetti {
  position: absolute;
  left: 39px;
  top: 50%;
  width: 0;
  height: 0;
  pointer-events: none;
}

.score .confetti {
  left: 90px;
  top: 40%;
}

.confetti i {
  position: absolute;
  width: 8px;
  height: 12px;
  border-radius: 2px;
  opacity: 0;
  animation: burst 1.1s var(--d) cubic-bezier(0.15, 0.7, 0.3, 1) forwards;
}

@keyframes burst {
  0% {
    opacity: 1;
    transform: translate(0, 0) rotate(0) scale(0.6);
  }
  70% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(var(--x), calc(var(--y) + 60px)) rotate(var(--r)) scale(1);
  }
}

@keyframes slam {
  0% {
    transform: rotate(-30deg) scale(3);
    opacity: 0;
  }
  60% {
    transform: rotate(-6deg) scale(0.92);
    opacity: 1;
  }
  100% {
    transform: rotate(-8deg) scale(1);
  }
}

@keyframes cheer {
  0%,
  100% {
    transform: none;
  }
  30% {
    transform: translateY(-6px) rotate(-1.5deg);
  }
  60% {
    transform: translateY(0) rotate(1deg);
  }
}

@keyframes bounce {
  0% {
    transform: rotate(-8deg) translateY(-40px) scale(0.8);
    opacity: 0;
  }
  40% {
    transform: rotate(-8deg) translateY(0) scale(1);
    opacity: 1;
  }
  60% {
    transform: rotate(-8deg) translateY(-12px);
  }
  80% {
    transform: rotate(-8deg) translateY(0);
  }
  90% {
    transform: rotate(-8deg) translateY(-3px);
  }
  100% {
    transform: rotate(-8deg) translateY(0);
  }
}

@keyframes wobble {
  0% {
    transform: rotate(-8deg) scale(0.6);
    opacity: 0;
  }
  30% {
    transform: rotate(6deg) scale(1.05);
    opacity: 1;
  }
  55% {
    transform: rotate(-14deg);
  }
  75% {
    transform: rotate(-4deg);
  }
  100% {
    transform: rotate(-8deg) scale(1);
  }
}

@keyframes shrug {
  0% {
    transform: rotate(-8deg) translateY(10px);
    opacity: 0;
  }
  60% {
    transform: rotate(-12deg) translateY(0);
    opacity: 1;
  }
  100% {
    transform: rotate(-8deg);
  }
}

@keyframes shake {
  0%,
  100% {
    transform: none;
  }
  20%,
  60% {
    transform: translateX(-7px);
  }
  40%,
  80% {
    transform: translateX(7px);
  }
}

@keyframes scribble {
  from {
    stroke-dashoffset: 160;
  }
}

@keyframes glow {
  0% {
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--yellow) 70%, transparent);
  }
  100% {
    box-shadow: 0 0 0 14px transparent;
  }
}

@keyframes flip {
  from {
    transform: rotateX(90deg) scale(0.8);
    opacity: 0;
  }
}

.stamp--green {
  color: var(--green);
  background: color-mix(in srgb, var(--green) 12%, transparent);
}

.stamp--yellow {
  color: #a87a06;
  background: color-mix(in srgb, var(--yellow) 22%, transparent);
}

@media (prefers-color-scheme: dark) {
  .stamp--yellow {
    color: var(--yellow);
  }
}

.stamp--blue {
  color: var(--blue);
  background: color-mix(in srgb, var(--blue) 12%, transparent);
}

.stamp--red {
  color: var(--red);
  background: color-mix(in srgb, var(--red) 10%, transparent);
}

@keyframes stamp {
  from {
    transform: rotate(-8deg) scale(1.9);
    opacity: 0;
  }
  to {
    transform: rotate(-8deg) scale(1);
    opacity: 1;
  }
}

.verdict-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 26px;
  line-height: 1.1;
  outline: none;
}

.you-said {
  margin-top: 6px;
  font-weight: 600;
}

.you-said q {
  quotes: '“' '”';
}

.you-said-read {
  font-weight: 400;
  color: var(--ink-faint);
}

.verdict-line {
  margin-top: 2px;
  color: var(--ink-soft);
  font-size: 15px;
}

.crowd {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.crowd-row {
  display: grid;
  grid-template-columns: 22px 1fr 44px;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  margin: 0 -10px;
  border-radius: 10px;
}

.crowd-row.is-mine {
  background: var(--highlight);
}

.crowd-rank {
  font: 800 18px/1 var(--font-display);
  color: var(--ink-faint);
}

.crowd-body {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.crowd-label {
  font-weight: 700;
  font-size: 18px;
  line-height: 1.2;
}

.crowd-bar {
  height: 8px;
  border-radius: 99px;
  background: color-mix(in srgb, var(--ink) 8%, transparent);
  overflow: hidden;
}

.crowd-bar span {
  display: block;
  height: 100%;
  width: var(--w);
  border-radius: inherit;
  background: var(--ink);
  animation: grow 0.7s 0.15s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.crowd-row--top .crowd-bar span {
  background: var(--green);
}

.crowd-row--high .crowd-bar span {
  background: var(--yellow);
}

.crowd-row--other .crowd-bar span {
  background: var(--ink-faint);
}

@keyframes grow {
  from {
    width: 0;
  }
}

.crowd-points {
  text-align: right;
  font-weight: 800;
  font-size: 14px;
  color: var(--ink-faint);
}

.crowd-row--top .crowd-points {
  color: var(--green);
}

.crowd-row--high .crowd-points {
  color: #a87a06;
}

@media (prefers-color-scheme: dark) {
  .crowd-row--high .crowd-points {
    color: var(--yellow);
  }
}

.crowd-row--mid .crowd-bar span {
  background: var(--blue);
}

.crowd-row--mid .crowd-points {
  color: var(--blue);
}

.scrawl--mine {
  font-size: 20px;
  margin-left: 4px;
}

.truth {
  margin: 28px 0 28px;
  padding-top: 20px;
  border-top: 2px dashed color-mix(in srgb, var(--ink) 18%, transparent);
}

.truth-answer {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 18px;
  margin: 10px 0 10px 8px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 26px;
}

.circled {
  position: relative;
}

.truth-why {
  color: var(--ink-soft);
}

/* ------------------------------------------------------------ results */

.results {
  text-align: left;
}

.score {
  display: flex;
  align-items: baseline;
  font-family: var(--font-display);
  line-height: 0.9;
  outline: none;
}

.score-num {
  font-weight: 800;
  font-size: clamp(84px, 26vw, 120px);
  letter-spacing: -0.04em;
}

.score-max {
  font-weight: 700;
  font-size: 30px;
  color: var(--ink-faint);
  margin-left: 6px;
}

.score-tiles {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}

.score-tiles .tile {
  width: 52px;
  height: 52px;
  border-radius: 10px;
  font-size: 18px;
}

.recap {
  list-style: none;
  margin: 26px 0 0;
  padding: 0;
  display: grid;
  gap: 14px;
}

.recap-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.recap-body {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.recap-q {
  font-weight: 700;
  line-height: 1.3;
}

.recap-a {
  font-size: 14px;
  color: var(--ink-soft);
}

.share {
  margin-top: 28px;
  padding: 18px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--desk) 70%, var(--paper));
}

.share-card {
  margin: 0;
  font: 500 15px/1.5 ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.share-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.share-status {
  margin-top: 10px;
  min-height: 1.4em;
  font-size: 14px;
  font-weight: 600;
  color: var(--green);
}

.share-status.is-warn {
  color: var(--ink-soft);
}

.share-fallback {
  width: 100%;
  margin-top: 8px;
  padding: 10px;
  border: 2px solid var(--ink-faint);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  font: 500 15px/1.5 ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  overflow-wrap: anywhere;
  resize: none;
}

.next-set {
  margin-top: 22px;
  color: var(--ink-soft);
}

.next-set strong {
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

/* ------------------------------------------------------------ footer */

.colophon {
  padding: 18px 4px 0;
  font-size: 13px;
  color: var(--ink-faint);
  text-align: center;
}

.colophon a {
  color: inherit;
}

/* ------------------------------------------------------------ prose pages */

.prose h1 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(34px, 9vw, 44px);
  line-height: 1.05;
}

.prose h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 21px;
  margin-top: 26px;
}

.prose p,
.prose ul {
  margin: 10px 0 0;
  color: var(--ink-soft);
}

.prose ul {
  padding-left: 20px;
}

.prose .btn {
  margin-top: 24px;
  text-decoration: none;
}

/* ------------------------------------------------------------ preview bar (local dev only) */

.preview {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  margin-bottom: 4px;
  padding: 6px 10px;
  border: 1px dashed var(--ink-faint);
  border-radius: 8px;
  font-size: 13px;
}

.preview-tag {
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--red);
}

.preview a {
  color: var(--ink);
  text-decoration: none;
  padding: 2px 6px;
}

.preview select,
.preview button {
  font: inherit;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--ink-faint);
  border-radius: 6px;
  padding: 3px 6px;
}

.preview button {
  margin-left: auto;
  cursor: pointer;
}

/* ------------------------------------------------------------ motion */

.sheet > section {
  animation: settle 0.32s ease-out both;
}

@keyframes settle {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ------------------------------------------------------------ archive */

.archive h1 {
  margin: 0 0 6px;
  font: 800 34px/1.1 var(--font-display);
}

.archive-day {
  margin: 18px 0;
  border-top: 2px solid var(--ink);
}

.archive-day summary {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 12px 0;
  cursor: pointer;
  list-style: none;
}

.archive-day summary::-webkit-details-marker {
  display: none;
}

.archive-day summary::after {
  content: '+';
  margin-left: auto;
  font: 700 24px/1 var(--font-hand);
  color: var(--red);
}

.archive-day[open] summary::after {
  content: '–';
}

.archive-no {
  font: 800 22px/1 var(--font-display);
}

.archive-date {
  color: var(--ink-soft);
  font-size: 15px;
}

.archive-q {
  padding: 14px 0 18px;
  border-top: 1px dashed color-mix(in srgb, var(--ink) 22%, transparent);
}

.archive-prompt {
  margin: 0 0 6px;
  font: 700 20px/1.25 var(--font-display);
}

.archive-right {
  margin: 0;
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
  font-weight: 700;
}

.archive-right s {
  text-decoration-color: var(--red);
  text-decoration-thickness: 2px;
}

.archive-tag {
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.archive-penalty {
  font-family: var(--font-hand);
  font-size: 22px;
  color: var(--red);
}

.archive-empty {
  color: var(--ink-soft);
}

.archive-months {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin: 14px 0 4px;
  font-weight: 700;
}

.archive-months span {
  color: var(--red);
  text-decoration: underline wavy var(--red);
  text-underline-offset: 4px;
}

.archive-months a {
  color: var(--ink);
  text-underline-offset: 4px;
}


/* ------------------------------------------------------------ streak + yesterday */

.streak-note {
  display: inline-block;
  margin: 0 0 14px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--highlight);
  font-size: 14px;
  color: var(--ink);
}

.streak-note--done {
  display: block;
  margin: 14px 0 0;
  text-align: center;
  border-radius: 12px;
}

.yesterday {
  margin-top: 28px;
  padding: 16px 18px;
  border: 2px solid color-mix(in srgb, var(--ink) 16%, transparent);
  border-radius: 12px;
  background: var(--paper);
}

.yesterday .section-label {
  margin: 0 0 8px;
}

.yesterday-q {
  margin: 4px 0 12px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  line-height: 1.25;
}

.yesterday-facts {
  margin: 0;
  display: grid;
  gap: 10px;
}

.yesterday-facts dt {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.yesterday-facts dd {
  margin: 2px 0 0;
  font-weight: 600;
  font-size: 17px;
}

.yesterday-note {
  margin: 14px 0 0;
  font-size: 14px;
  color: var(--ink-soft);
}

.yesterday-facts .yesterday-sub {
  margin-top: 2px;
  font-size: 13px;
  font-weight: 400;
  color: var(--ink-soft);
}

.yesterday-facts .circled {
  margin-right: 10px;
}
