/* =====================================================================
   CHAPTER STYLES (chapters 1 to 5). You do not need to edit this file.
   ===================================================================== */

/* ---------- shared bits ---------- */
.mini-title { font-family: var(--font-display); font-weight: 400; font-size: clamp(21px, 5.6vw, 28px); line-height: 1.15; margin: 0 0 8px; color: var(--brown); }
.page-no { text-align: center; font-family: var(--font-type); font-size: 13px; color: var(--muted); letter-spacing: .2em; margin: 44px 0 0; }
.chapter-music { margin-top: 32px; }
.doodle { display: inline-block; line-height: 0; }
.big-hand { font-size: clamp(30px, 8.4vw, 46px); line-height: 1.08; margin: 0; }
.spread { display: grid; gap: 22px; margin-block: 38px; }

/* ---------- Chapter 1: baby Dan-Dan (tender, airy) ---------- */
.ch1 { background-color: #fbf3e0; }
.ch1-sticker { margin: 0 0 22px; }
.ch1-big { position: relative; margin: 0 0 18px; padding-right: 14px; }
.arrow-ch1 { display: block; margin: 4px 0 0 52%; transform: rotate(8deg); }
.ch1-body { font-size: 1.08em; max-width: 34ch; }
.ch1-album { display: flex; flex-direction: column; gap: 34px; margin: 38px 0 34px; }
.ch1-album .a1 { width: 66%; }
.ch1-album .a2 { width: 58%; margin-left: auto; }
.ch1-album .a3 { width: 82%; margin-left: 6%; }
.ch1-album .a4 { width: 64%; margin-left: auto; margin-right: 6%; }
.ch1-archive { margin-top: 20px; max-width: 420px; margin-left: auto; }
.ch1-archive .note { display: grid; gap: 6px; font-size: 22px; }
.archive-label { font-family: var(--font-type); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--denim); }

/* ---------- Chapter 2: the little drummer boy (lively) ---------- */
.ch2 { background-color: #f4f0dc; }
.ch2::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 14px;
  background: repeating-linear-gradient(90deg, var(--brick) 0 14px, var(--brown) 14px 18px);
}
.ch2-stub-row { margin: 0 0 6px; }
.stub {
  display: inline-block; padding: 12px 22px; font-family: var(--font-type); font-size: 13px; letter-spacing: .12em;
  background: var(--butter); color: var(--brown); transform: rotate(-2deg);
  -webkit-mask: radial-gradient(circle 9px at 0 50%, #0000 98%, #000) left / 51% 100% no-repeat, radial-gradient(circle 9px at 100% 50%, #0000 98%, #000) right / 51% 100% no-repeat;
          mask: radial-gradient(circle 9px at 0 50%, #0000 98%, #000) left / 51% 100% no-repeat, radial-gradient(circle 9px at 100% 50%, #0000 98%, #000) right / 51% 100% no-repeat;
  box-shadow: var(--shadow-sm);
}
.ch2-drum-spread, .ch2-home-spread, .ch2-loved-spread { display: grid; gap: 22px; margin-block: 40px; }
.ch2-drum-photo, .ch2-home-photo, .ch2-loved-photo { width: 82%; justify-self: center; }
.ch2-drum-text .doodle { margin-right: 10px; vertical-align: middle; }
.ch2-drum-text .doodle.notes { }
.ch2-wall { position: relative; display: flex; flex-direction: column; margin: 20px 0 42px; }
.ch2-wall .w1 { width: 56%; }
.ch2-wall .w2 { width: 50%; align-self: flex-end; margin-top: -26%; }
.ch2-siblings { margin-top: 28px; }
.sib-note { margin: 12px 0 0; }
.ch2-note { margin-top: 30px; font-family: var(--font-hand); font-size: 24px; }

/* ---------- Chapter 3: case file (funniest) ---------- */
.ch3 { background-color: #5a4331; background-image: radial-gradient(rgba(255,255,255,.05) 1px, transparent 1px); }
.ch3 .chapter-title { color: var(--cream); }
.ch3 .chapter-sub { color: var(--butter); }
.ch3 .chapter-num { color: #f0a090; }
.ch3 .page-no { color: rgba(246, 238, 219, .75); }
.folder { position: relative; margin-top: 30px; }
.folder-tab {
  display: inline-block; background: #e1c27c; color: var(--brown); font-family: var(--font-type); font-size: 12px; letter-spacing: .12em;
  padding: 8px 16px 6px; border-radius: 10px 10px 0 0; margin-left: 12px;
}
.folder-body { background: #e8cf94; padding: 22px 14px 28px; box-shadow: var(--shadow-md); border-radius: 0 6px 6px 6px; }
.case-question { font-family: var(--font-display); font-size: clamp(24px, 6.8vw, 34px); line-height: 1.1; margin: 0 0 6px; color: var(--brown); }
.case-status { margin: 0 0 22px; color: var(--brick); font-size: 14px; }
.exhibits { display: grid; gap: 30px; }
.evidence { position: relative; background: var(--paper); padding: 22px 14px 16px; box-shadow: var(--shadow-sm); }
.evidence:nth-child(odd) { transform: rotate(-.6deg); }
.pin { position: absolute; top: -8px; left: 50%; transform: translateX(-50%); z-index: 4; line-height: 0; }
.ex-tag { display: inline-block; background: var(--brick); color: var(--cream); font-size: 12px; letter-spacing: .14em; padding: 3px 10px; margin-bottom: 10px; }
.ex-title { font-family: var(--font-display); font-weight: 400; font-size: 21px; margin: 12px 0 4px; color: var(--brown); }
.ex-text { margin: 0; font-size: 16px; }
.ch3-extra { width: 58%; margin: 30px auto 0; }
.ch3-turn { display: grid; gap: 28px; margin-top: 44px; }
.grave-card { background: var(--paper); padding: 22px 16px 24px; box-shadow: var(--shadow-md); display: grid; gap: 14px; }
.grave-card .slot { width: 66%; justify-self: center; }
.ch3-drive .note { display: grid; gap: 6px; }
.loading { margin-top: 44px; background: #1d1612; padding: 18px 16px 20px; border-radius: 6px; border: 3px solid var(--butter); }
.load-label { color: var(--butter); font-size: 13px; letter-spacing: .14em; text-transform: uppercase; margin-bottom: 10px; }
.load-track { height: 24px; border: 3px solid var(--cream); background: transparent; padding: 2px; }
.load-fill { height: 100%; width: 78%; background: repeating-linear-gradient(90deg, var(--butter) 0 10px, #d4b64d 10px 14px); }
.reveal.is-in .load-fill { animation: fillbar 2.8s steps(16) both; }
@keyframes fillbar { from { width: 0; } }
.load-caption { color: var(--cream); margin: 14px 0 0; font-size: 24px; }

/* ---------- Chapter 4: university (lecture notes + receipt) ---------- */
.ch4 { background-color: #eef0e6; }
.notes-sheet {
  position: relative; margin-top: 26px; padding: 18px 14px 20px 52px; background-color: #fffef8;
  background-image: repeating-linear-gradient(transparent 0 31px, rgba(76, 106, 140, .32) 31px 32px);
  box-shadow: var(--shadow-md); transform: rotate(-.5deg);
}
.notes-sheet::before { content: ""; position: absolute; top: 0; bottom: 0; left: 38px; width: 2px; background: rgba(178, 57, 44, .55); }
.notes-head { margin: 0 0 14px; font-size: 12px; letter-spacing: .12em; color: var(--denim); line-height: 32px; }
.career-line, .studious-line { margin: 0; font-size: 22px; line-height: 32px; font-weight: 700; }
.career-edit { margin: 0; line-height: 40px; }
.struck { font-size: 22px; text-decoration: line-through; text-decoration-color: var(--brick); text-decoration-thickness: 3px; color: var(--muted); margin-right: 10px; }
.scribble { display: inline-block; transform: rotate(-4deg); font-size: 34px; }
.margin-note { margin: 0; line-height: 32px; font-size: 24px; }
.studious { margin-top: 18px; }
.ch4-photos { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; margin-top: 34px; align-items: start; }
.ch4-photos > :last-child { margin-top: 22px; }
.ch4-print { margin-top: 48px; display: grid; gap: 22px; }
.print-row { display: grid; gap: 28px; justify-items: center; }
.receipt { position: relative; width: min(100%, 310px); background: #fffef8; padding: 18px 18px 6px; font-size: 14px; color: var(--ink); box-shadow: var(--shadow-sm); transform: rotate(1.4deg); }
.receipt::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -14px; height: 14px;
  background: linear-gradient(-45deg, transparent 7px, #fffef8 0), linear-gradient(45deg, transparent 7px, #fffef8 0);
  background-size: 14px 14px; background-position: left bottom;
}
.rc-shop { text-align: center; font-size: 17px; letter-spacing: .14em; }
.rc-owner { text-align: center; color: var(--muted); font-size: 12px; margin-bottom: 4px; }
.receipt hr { border: 0; border-top: 1px dashed var(--muted); margin: 10px 0; }
.rc-line { display: flex; gap: 6px; align-items: baseline; padding: 2px 0; }
.rc-line .dots { flex: 1; border-bottom: 2px dotted rgba(122, 102, 84, .55); transform: translateY(-3px); min-width: 12px; }
.rc-total { font-weight: bold; }
.rc-thanks { text-align: center; margin: 14px 0 22px; font-size: 13px; }
.print-logo { width: 46%; }
.ch4-closing { margin: 40px 0 0; font-size: 1.5em; max-width: 24ch; }

/* ---------- Chapter 5: law school (celebration) ---------- */
.ch5 { background-color: #fbf5df; }
.payoff { position: relative; padding: 8px 0 54px; }
.payoff-intro { font-family: var(--font-hand); font-size: clamp(24px, 6.4vw, 32px); color: var(--denim); margin: 0 0 6px; line-height: 1.1; }
.payoff-line { font-family: var(--font-display); font-size: clamp(34px, 10vw, 60px); line-height: 1.02; margin: 0; color: var(--brown); text-wrap: balance; background: linear-gradient(transparent 60%, rgba(243, 211, 107, .85) 60%); display: inline; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.stamp {
  position: absolute; right: 2px; bottom: 0; transform: rotate(-11deg);
  font-family: var(--font-display); font-size: clamp(20px, 6vw, 30px); letter-spacing: .08em;
  color: var(--brick); border: 4px solid var(--brick); padding: 4px 14px; border-radius: 6px; opacity: .88; background: rgba(251, 245, 223, .6);
}
.ch5-notes { display: grid; gap: 28px; margin-top: 18px; }
.exam-sheet { position: relative; padding: 22px 16px 18px; background: #fffef8; box-shadow: var(--shadow-md); transform: rotate(.8deg); }
.exam-line { margin: 0 0 10px; font-family: var(--font-type); font-size: 16px; }
.coffee-ring { position: absolute; bottom: 12px; right: 16px; width: 54px; height: 54px; border-radius: 50%; border: 5px solid rgba(138, 85, 40, .28); box-shadow: inset 0 0 0 2px rgba(138, 85, 40, .12); }
.ch5-celebrate { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; margin-top: 36px; align-items: start; }
.ch5-celebrate > :last-child { margin-top: 26px; }
.ch5-faith { margin-top: 38px; }
.faith-note { display: grid; gap: 6px; }

/* ---------- tablet and up ---------- */
@media (min-width: 700px) {
  .ch1-album { display: grid; grid-template-columns: repeat(2, 1fr); align-items: start; gap: 24px; }
  .ch1-album .a1, .ch1-album .a2, .ch1-album .a3, .ch1-album .a4 { width: auto; margin: 0; }
  .ch1-album .a2 { margin-top: 36px; }
  .ch2-drum-spread, .ch2-home-spread, .ch2-loved-spread { grid-template-columns: 1fr 1fr; align-items: center; gap: 36px; }
  .ch2-drum-photo, .ch2-home-photo, .ch2-loved-photo { width: 100%; }
  .ch2-wall { flex-direction: row; justify-content: center; gap: 0; }
  .ch2-wall .w1 { width: 34%; }
  .ch2-wall .w2 { width: 32%; margin: 30px 0 0 -4%; align-self: auto; }
  .exhibits { grid-template-columns: repeat(3, 1fr); gap: 20px; }
  .ch3-turn { grid-template-columns: 1.3fr 1fr; align-items: start; }
  .print-row { grid-template-columns: 1fr 1fr; align-items: start; }
  .ch5-notes { grid-template-columns: 1fr 1fr; align-items: center; }
}

@media (prefers-reduced-motion: reduce) {
  .reveal.is-in .load-fill { animation: none; }
}

/* readable empty-music slot on the dark case-file page */
.ch3 .music.is-empty { color: var(--cream); border-color: rgba(246, 238, 219, .6); }
.ch3 .music.is-empty .music-btn { color: var(--cream); border-color: var(--cream); }

.slot { min-width: 0; }
.slot-ph { min-width: 0; overflow: hidden; overflow-wrap: anywhere; }

/* ch2 narrative blocks and uncle photos */
.ch2-narr { margin-block: 30px; }
.ch2-doodles { display: flex; align-items: center; gap: 16px; margin-top: 10px; }
.ch2-uncles { display: flex; flex-direction: column; gap: 26px; margin: 26px 0 34px; align-items: center; }
.ch2-uncles .u1, .ch2-uncles .u2 { width: 78%; }
.ch2-uncles .u2:empty { display: none; }
@media (min-width: 760px) {
  .ch2-uncles { flex-direction: row; justify-content: center; align-items: flex-start; }
  .ch2-uncles .u1, .ch2-uncles .u2 { width: 40%; }
}
