/* A shared ending: the room stays grounded while the working page settles in. */
.desk-finale {
  --finale-progress: 1;
  --finale-display: var(--display, var(--serif, Georgia, serif));
  --finale-text: var(--text, var(--sans, sans-serif));
  position: relative; isolation: isolate; display: block;
  min-height: 1000px; padding: 100px 28px 190px;
  overflow: clip; background: #19374b; color: #f6f3e9;
}
.desk-finale::before, .desk-finale::after { display: none; }
.finale-room {
  position: absolute; z-index: -2; inset: auto 0 0; height: 1000px;
  background: url('../images/course-desk.webp') center bottom / cover no-repeat;
  mask-image: linear-gradient(transparent, #000 23%);
  transform: translateY(calc((1 - var(--finale-progress)) * 40px));
}
.finale-edge {
  position: absolute; z-index: 4; bottom: -1px; left: 0; right: 0; height: 145px;
  background: url('../images/desk-walnut-continuation.webp') center 65% / cover;
  mask-image: linear-gradient(transparent, #000 35%);
  transform: translateY(calc((1 - var(--finale-progress)) * 90px));
  pointer-events: none;
}
.finale-edge::after { content: ''; position: absolute; inset: 0; background: linear-gradient(transparent, #102a39 94%); }
.desk-finale .close-copy { position: relative; z-index: 2; max-width: 860px; margin: 0 auto; text-align: center; }
.desk-finale .close-copy h2 { max-width: 21ch; margin: 0 auto; font: 400 clamp(38px, 4.5vw, 66px)/1.06 var(--finale-display); letter-spacing: -.04em; }
.desk-finale .close-copy .eyebrow { margin-bottom: 20px; }
.desk-finale .close-copy > p:last-of-type { max-width: 51ch; margin: 24px auto 0; font: 16px/1.65 var(--finale-text); color: #c3d5d8; }
.desk-finale .hero-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; margin-top: 26px; }
.desk-finale .hero-actions .button:not(.button--accent) { background: #19374b; border: 1px solid #c3d5d880; color: #f6f3e9; }
.desk-finale .hero-actions .button--accent { color: #19374b; background: #b9d8c9; }
.desk-finale .confidence-sheet {
  position: relative; z-index: 3; width: min(540px, 90%); max-width: none;
  margin: 72px auto 0; padding: 30px 36px; color: #19374b; background: #f6f3e9;
  border-radius: 4px; border: 1px solid #e0dbc9;
  box-shadow: 6px 28px 38px -16px #061a2690, 0 3px 4px #061a2650;
  opacity: 1; transition: none;
  transform: translateY(calc((1 - var(--finale-progress)) * 90px)) rotate(calc((1 - var(--finale-progress)) * -3deg));
  transform-origin: center bottom;
}
.desk-finale .confidence-sheet header { padding-bottom: 18px; border-bottom: 1px solid #19374b40; }
.desk-finale .confidence-sheet header small { color: #42606a; font: 12px/1.5 var(--finale-text); }
.desk-finale .confidence-sheet header strong { display: block; margin-top: 6px; font: 32px/1.2 var(--finale-display); }
.desk-finale .check-line { display: flex; gap: 14px; padding: 15px 0; border-bottom: 1px solid #19374b25; font: 16px/1.55 var(--finale-text); }
.desk-finale .check-line i { flex-shrink: 0; display: grid; place-items: center; width: 22px; height: 24px; font-style: normal; color: #31584e; background: none; }
.desk-finale .check-line:last-child { border-bottom: 0; }
.site-footer, .detail-footer { position: relative; background: #102a39; }

/* More than entry fades: the paper and its tab have separate scroll depth. */
.motion-ready .detail-hero .hero-sheet { transform: translateY(var(--hero-paper-y, 0px)) rotate(var(--hero-paper-r, -2deg)); }
.motion-ready .detail-hero .hero-tab { transform: translateY(var(--hero-tab-y, 0px)) rotate(2deg); }
.motion-ready .detail-hero::before { transform: translateY(var(--hero-room-y, 0px)); }
.motion-ready .case-card[data-in]:not(.is-in) { transform: translateY(22px) rotate(-1.5deg); }
.motion-ready .case-card[data-in].is-in { transform: none; }
.motion-ready .lesson-card { position: relative; }
.motion-ready .lesson-card::after { content: ''; position: absolute; inset: -1px 0 auto; height: 2px; background: #dec895; transform: scaleX(var(--lesson-progress, 0)); transform-origin: left; pointer-events: none; }
.motion-ready .resource-bench .resource-card:nth-child(even) { transition-delay: 70ms; }
.soap-transfer { position: fixed; z-index: 30; margin: 0; padding: 8px 12px; border-radius: 20px; background: #dec895; color: #19374b; font: 12px/1.4 var(--text); pointer-events: none; box-shadow: 0 6px 12px #071b2840; }
.practice-can-pin .assessment-instrument .review-lens {
  display: block; position: absolute; inset: 0 auto auto 0;
  width: 3px; height: 1px; aspect-ratio: auto; border: 0; border-radius: 0;
  background: #a0803c; box-shadow: none; transform-origin: top left;
  transition: transform 280ms cubic-bezier(.23,1,.32,1);
}
.practice-can-pin .assessment-instrument .review-lens::after { display: none; }

@media (min-width: 761px) {
  .motion-ready .practice-can-pin .plan-strip { transform: translateX(18px); transition: transform 280ms ease-out, background 240ms ease-out; }
  .motion-ready .practice-can-pin .plan-strip.is-revealed { transform: translateX(0); }
}
@media (max-width: 760px) {
  .desk-finale { min-height: 0; padding: 72px 22px 155px; }
  .finale-room { height: 780px; background-size: auto 100%; }
  .desk-finale .close-copy h2 { font-size: 38px; }
  .desk-finale .confidence-sheet { width: 100%; padding: 25px 22px; margin-top: 55px; }
  .desk-finale .confidence-sheet header strong { font-size: 28px; }
  .desk-finale .check-line { font-size: 15px; }
  .finale-edge { height: 115px; }
}
@media (prefers-reduced-motion: reduce) {
  .finale-room, .finale-edge, .desk-finale .confidence-sheet,
  .motion-ready .detail-hero .hero-sheet, .motion-ready .detail-hero .hero-tab,
  .motion-ready .detail-hero::before, .motion-ready .case-card { transform: none !important; }
  .motion-ready .lesson-card::after { transform: scaleX(1); }
  .soap-transfer { display: none; }
}
