/* The six chapters share one sheet of paper and a single reading line. */
.course-program {
  --paper: #fbf3e4;
  --headline: var(--brand-red, #c22829);
  --gold: #d8b579;
  --secondary: #4f3d30;
  --content-width: min(75%, 1170px);
  color: #31251e;
  background: radial-gradient(ellipse at 7% 7%, #efcf8d20, transparent 38%),
    linear-gradient(130deg, #faefdc 0%, #fffbf2 32%, #fcf5e8 66%, #f8ecd6 100%);
  border-top: 1px solid #dec8a2;
  padding-block: clamp(38px, 3.8vw, 66px) clamp(38px, 4vw, 64px);
}
.program-intro, .chapter-timeline {
  width: var(--content-width);
  margin-inline: auto;
}
.program-intro { text-align: center; }
.program-intro h2 {
  width: fit-content;
  margin: 0 auto clamp(17px, 1.7vw, 26px);
  color: var(--headline);
  font: 400 clamp(39px, 4vw, 66px)/1.04 var(--display);
  letter-spacing: -.05em;
}
@supports (background-clip: text) or (-webkit-background-clip: text) {
  .program-intro h2 {
    background: linear-gradient(105deg, var(--headline) 8%, #942e22 43%, #644323 63%, #291d17 86%);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
  }
}
@media (forced-colors: active) {
  .program-intro h2 { background: none; color: CanvasText; }
}
.chapter-index {
  border-block: 1px solid var(--headline);
  border-image: linear-gradient(90deg, var(--headline), #c58552 26%, var(--gold) 32%, #b77443 41%, var(--headline) 76%) 1;
}
.chapter-index ol { margin: 0; padding: 0; display: flex; justify-content: space-between; list-style: none; }
.chapter-index a {
  display: flex; align-items: center; justify-content: center; gap: .4em;
  min-height: 48px; line-height: 1.18; font-size: 16px; padding: 5px 3px;
}
.chapter-index small { color: var(--headline); font-size: .78em; font-variant-numeric: tabular-nums; }
.chapter-index a:hover { color: var(--headline); }
.chapter-timeline {
  --rail-x: 50%;
  margin-top: clamp(15px, 2vw, 28px);
}
.chapter {
  --padding-y: clamp(15px, 1.4vw, 23px);
  --node-y: calc(var(--padding-y) + 9px);
  position: relative;
  scroll-margin-top: 15px;
}
.chapter::before, .chapter::after { content: ""; position: absolute; left: var(--rail-x); pointer-events: none; }
.chapter::before {
  top: 0; bottom: 0; width: 1px;
  background: var(--headline);
  box-shadow: 1px 0 2px #d8a9547a;
}
.chapter:first-child::before { top: var(--node-y); }
.chapter:last-child::before { height: var(--node-y); }
.chapter::after {
  top: var(--node-y);
  width: 10px; height: 10px; border-radius: 50%;
  transform: translate(-50%, -50%);
  background: var(--headline); box-shadow: 0 0 0 3px var(--paper), 0 0 0 4px var(--gold), 0 0 9px #ce982f4d;
}
.chapter-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  column-gap: clamp(42px, 5.5vw, 88px);
  padding-block: var(--padding-y);
}
.chapter-copy { grid-column: 1; grid-row: 1; align-self: start; min-width: 0; }
.chapter:nth-child(even) .chapter-copy { grid-column: 2; }
.chapter:nth-child(even) .phones { grid-column: 1; }
.chapter-kicker {
  font: 600 13px/18px "Roboto Condensed", sans-serif;
  text-transform: uppercase; letter-spacing: .1em; color: var(--headline);
  display: flex; align-items: center; gap: .8em;
  margin: 0 0 7px;
}
.chapter-kicker::after {
  content: ""; flex: 1; height: 1px;
  background: linear-gradient(90deg, var(--headline), var(--gold) 64%, transparent);
}
.chapter h3 {
  color: var(--headline);
  font: 400 clamp(30px, 2.65vw, 44px)/1.03 var(--display);
  letter-spacing: -.045em; margin: 0 0 15px; text-wrap: balance;
}
.chapter h4 { color: var(--headline); font: 650 15px/1.25 "Roboto Condensed", sans-serif; margin: 0 0 5px; }
.lesson-items, .chapter-tasks { list-style: none; padding: 0; margin: 0; }
.lesson-items { font-size: 17px; line-height: 1.32; }
.lesson-items li { display: inline; }
.lesson-items li:not(:last-child)::after { content: " · "; color: var(--headline); font-weight: 700; }
.chapter h4.chapter-tasks-heading { margin-top: 14px; }
.chapter-tasks li { font-size: 17px; line-height: 1.35; color: var(--secondary); }
.chapter-tasks li + li { margin-top: 7px; }
.chapter-tasks strong { color: #34271f; font-weight: 650; }
.phones {
  grid-column: 2; grid-row: 1; justify-self: center;
  width: min(100%, 470px);
  min-width: 0; margin: 0;
}
/* Keep the source arrangement, and bring the two rows closer as the phones grow. */
.contact-sheet { position: relative; isolation: isolate; width: 100%; aspect-ratio: 1.07; }
.chapter:is([data-module="3"], [data-module="5"]) .contact-sheet { aspect-ratio: 1.12; }
.chapter:is([data-module="4"], [data-module="6"]) .contact-sheet { aspect-ratio: 1.21; }
.contact-sheet::after {
  content: ""; position: absolute; z-index: -1; left: 7%; right: 7%; bottom: 0; height: 7%;
  border-radius: 50%; background: #9b76553b; filter: blur(9px);
}
.phone-shot {
  position: absolute; z-index: var(--layer,1);
  left: calc(var(--x) + var(--w) * .045); top: calc(var(--y) * .72); width: calc(var(--w) * .91);
  padding: 0; border: 0; background: transparent; cursor: zoom-in; border-radius: 12%;
  aspect-ratio: 1101/2076; transition: transform .16s ease;
}
.phone-shot img { width: 100%; height: 100%; object-fit: contain; user-select: none; }
.chapter[data-module="5"] .phone-shot:nth-child(2) { left: 44%; }
.phone-shot:focus-visible { z-index: 12; outline: 2px solid var(--headline); outline-offset: -3px; }
@media (hover:hover) { .phone-shot:hover { z-index: 12; transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { .phone-shot { transition: none; } }
.credits { background: #261a15; color: #fff2df; }
.credits-line { width: min(75%, 1170px); margin-inline: auto; display: flex; justify-content: space-between; align-items: center; gap: 18px; padding-block: 18px; }
.credits-brand { font: 400 clamp(19px, 2vw, 29px)/1.1 var(--display); letter-spacing: -.04em; }
.credits a { display: inline-flex; align-items: center; min-height: 44px; font-size: 16px; text-decoration: underline; text-underline-offset: .25em; }
.credits a:focus-visible { outline-color: #ffdda7; }
@media (max-width: 1090px) {
  .course-program { --content-width: calc(100% - 80px); }
  .credits-line { width: calc(100% - 80px); }
  .chapter-index ol { display: grid; grid-template-columns: repeat(3, 1fr); }
  .chapter-index a { min-height: 40px; }
}
@media (max-width: 720px) {
  .course-program { --content-width: calc(100% - 36px); padding-bottom: 32px; }
  .program-intro h2 { font-size: clamp(35px, 7vw, 49px); }
  .chapter-index ol { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .chapter-index a { min-height: 40px; justify-content: flex-start; padding-inline: 3px; }
  .chapter-timeline { --rail-x: 5px; margin-top: 10px; }
  .chapter { --padding-y: 16px; padding-left: 25px; }
  .chapter::after { width: 8px; height: 8px; }
  .chapter-grid { display: flex; flex-direction: column; align-items: stretch; gap: 13px; }
  .chapter-kicker { margin-bottom: 5px; letter-spacing: .065em; }
  .chapter h3 { margin-bottom: 10px; font-size: clamp(28px, 6vw, 36px); }
  .chapter-tasks li, .lesson-items { font-size: 16px; line-height: 1.37; }
  .phones { align-self: center; width: min(470px, calc(100% + 16px)); margin-inline: -12px -4px; }
  .credits-line { width: var(--content-width, calc(100% - 36px)); }
}
.viewer {
  width: min(640px, 94vw); height: min(840px, 94vh); height: min(840px, 94dvh);
  max-width: 96vw; max-height: 96dvh; padding: 0;
  border: 1px solid #b6977d; border-radius: 12px;
  background: #fcf6ea; color: #2e2119; box-shadow: 0 18px 85px #160d0980;
}
.viewer[open] { display: grid; grid-template-rows: auto minmax(0,1fr) auto; }
.viewer::backdrop { background: rgba(29,19,15,.85); }
body:has(.viewer[open]) { overflow: hidden; }
.viewer-bar, .viewer-tools { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 14px; }
.viewer-bar { border-bottom: 1px solid #d0bfa8; }
.viewer-title { font-size: clamp(17px,1.4vw,22px); font-weight: 600; line-height: 1.25; }
.viewer button {
  min-height: 40px; cursor: pointer; padding: 5px 11px; border: 1px solid transparent; border-radius: 4px;
  background: var(--brand-red, #c22829); color: #fffaf0; font: 500 16px/1.3 "Roboto Condensed",sans-serif;
}
.viewer button:hover, .viewer button:active { background: #a01e1f; }
.viewer button[aria-pressed="true"] { background: var(--brand-red, #c22829); box-shadow: inset 0 0 0 2px #f4dba7; }
.viewer button:focus-visible { outline: 2px solid #49301c; outline-offset: 2px; }
.viewer-stage { min-height: 0; min-width: 0; overflow: auto; background: #e9dfcf; scrollbar-gutter: stable both-edges; }
.viewer-stage img { width: 100%; height: 100%; object-fit: contain; max-width: none; }
.viewer.zoomed .viewer-stage img { width: max(100%, 620px); height: auto; margin: 0 auto; }
.viewer-tools { border-top: 1px solid #d0bfa8; }
.viewer-tools span { font-variant-numeric: tabular-nums; font-size: 15px; color: #5a4737; }
@media (max-width:440px) { .viewer button { font-size: 15px; padding: 5px 9px; } .viewer-tools,.viewer-bar { padding: 7px 8px; gap: 5px; } }

.viewer-heading { min-width: 0; }
#screen-level { display: block; font-size: 13px; line-height: 1.25; }
