/* Why Your African Parents Don't Believe in Your Crazy Dream
   Concept: the primary school exercise book. Blue ink, the teacher's red pen,
   and a gold star the essay finally awards to the crazy dream. */

html.theme-parents {
  --fg: #1a1d2b;
  --muted: #5f6474;
  --accent: #d9483b;
  --ink: #1d3f9a;
  --gold: #c8892b;
  --rule: #e4e1da;
  --surface: #f7f5f0;
  --selection: #ffe2b8;
  --font-display: 'DM Serif Display', Georgia, serif;
  --hand: 'Caveat', 'Bradley Hand', cursive;
}

/* ---------------------------------------------------------------- hero */

.ap-hero { display: grid; gap: clamp(2rem, 5vw, 3rem); }

.theme-parents .hero-title {
  font: 400 clamp(2.2rem, 1rem + 3.6vw, 4rem)/1.02 var(--font-display); letter-spacing: -0.01em;
}
.theme-parents .hero-title span {
  display: block; margin-top: 0.6rem;
  font-size: 0.45em; font-style: italic; line-height: 1.2; color: var(--gold);
}
.theme-parents .hero-dek { font-style: normal; }

.exercise {
  position: relative; margin: 0;
  padding: 1.6rem 1.4rem 1.6rem 4.2rem;
  background:
    linear-gradient(90deg, transparent 3.1rem, #e9a39b 3.1rem 3.2rem, transparent 3.2rem),
    repeating-linear-gradient(#fffdf7 0 calc(2.3rem - 1px), #b9d2ec calc(2.3rem - 1px) 2.3rem);
  background-color: #fffdf7;
  border-radius: 3px;
  box-shadow: 0 1px 0 #e4e1da, 0 24px 40px -28px rgb(26 29 43 / 0.45);
  rotate: -1deg; max-width: 34rem;
  font-family: var(--hand); color: var(--ink);
  line-height: 2.3rem;
}
.ex-q, .ex-note { margin: 0; }
.ex-q { font-weight: 700; font-size: 1.55rem; color: var(--fg); }
.ex-a { list-style: none; margin: 0; padding: 0; counter-reset: ans; }
.ex-a li { counter-increment: ans; font-size: 1.7rem; font-weight: 500; position: relative; }
.ex-a li::before { content: counter(ans) '.'; position: absolute; left: -2.3rem; font-size: 1.2rem; color: var(--muted); }

/* Handwriting: each line is "written" left to right */
.ex-q, .ex-a .ink, .ex-note span {
  display: inline-block;
  clip-path: inset(0 100% 0 0);
  animation: write 0.9s steps(18) forwards;
}
.ex-q { animation-delay: 0.3s; animation-duration: 1.3s; }
.ex-a .ink { animation-delay: calc(1.6s + var(--i) * 0.9s); }
.dream .ink { animation-duration: 1.4s; }
@keyframes write { to { clip-path: inset(0 0 0 0); } }

.mark {
  display: inline-block; margin-left: 0.6rem; font-weight: 700; font-size: 1.9rem;
  opacity: 0; scale: 1.8;
  animation: mark 0.35s cubic-bezier(.3,1.6,.5,1) forwards;
  animation-delay: calc(2.3s + var(--i) * 0.9s);
}
.mark.ok, .mark.no { color: var(--accent); }
@keyframes mark { to { opacity: 1; scale: 1; } }

.ex-note { font-size: 1.6rem; font-weight: 700; }
.ex-note .ex-red { color: var(--accent); animation-delay: 5.9s; position: relative; }
.ex-note .ex-gold { color: var(--gold); margin-left: 0.4rem; animation-delay: 7.6s; animation-duration: 1.2s; }

/* The verdict changes: the teacher's note is struck out and the dream gets a gold star */
.ex-red::after {
  content: ''; position: absolute; left: -2%; right: -2%; top: 55%; height: 3px; border-radius: 2px;
  background: var(--gold); transform: scaleX(0); transform-origin: left;
  animation: strike 0.5s ease-out 7s forwards;
}
@keyframes strike { to { transform: scaleX(1); } }
.dream .mark.no { animation: mark 0.35s cubic-bezier(.3,1.6,.5,1) 5.4s forwards, fade 0.4s ease-in 7.2s forwards; }
@keyframes fade { to { opacity: 0; scale: 0.6; } }
.mark.star {
  position: absolute; color: var(--gold); margin-left: -1.6rem; font-size: 2.1rem;
  animation: star 0.6s cubic-bezier(.3,1.8,.5,1) 7.5s forwards;
}
@keyframes star { from { opacity: 0; scale: 2.5; rotate: -40deg; } to { opacity: 1; scale: 1; rotate: 0deg; } }

@media (prefers-reduced-motion: reduce) {
  .ex-q, .ex-a .ink, .ex-note span { clip-path: none; }
  .mark { opacity: 1; scale: 1; }
  .dream .mark.no { opacity: 0; }
  .ex-red::after { transform: scaleX(1); }
}

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

.theme-parents .prose h2 { font: 400 clamp(1.8rem, 1.2rem + 2vw, 2.6rem)/1.08 var(--font-display); }
.theme-parents .prose h2::after {
  content: ''; display: block; width: 3rem; height: 3px; margin-top: 0.7rem; background: var(--gold); border-radius: 2px;
}

/* The asides read like notes scribbled in the margin of the exercise book */
.theme-parents .prose blockquote {
  border-left: 0; padding: 0 0 0 0.2rem;
  font: 600 1.85rem/1.15 var(--hand); color: var(--ink);
  rotate: -1deg;
}
.theme-parents .prose blockquote::before { content: '✎ '; color: var(--accent); font-size: 0.8em; }
.theme-parents .prose strong { color: var(--ink); }
.theme-parents .prose figcaption { font: 500 1.3rem/1.2 var(--hand); color: var(--ink); }
