@font-face { font-family: Caveat; src: url("./vendor/caveat-bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }

:root {
  color-scheme: light;
  --ink: #292b26;
  --soft-ink: #575245;
  --paper: #f6ecd8;
  --red: #9c3a2d;
  --desk-text: #f3e5ca;
  --mono: ui-monospace, "SFMono-Regular", Consolas, monospace;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  min-height: 100svh;
  color: var(--ink);
  background: radial-gradient(ellipse at 44% -10%, #4a5a4a, transparent 68%), repeating-linear-gradient(90deg, #ffffff03 0 1px, transparent 1px 7px), #1e3332;
  font: 16px/1.48 Georgia, serif;
}
button, input { font: inherit; }
button { color: inherit; cursor: pointer; }
button:disabled { cursor: default; }
button:focus-visible, input:focus-visible, a:focus-visible { outline: 2px solid #ba6141; outline-offset: 4px; }
a { color: inherit; text-underline-offset: 3px; }
.masthead, main, footer { width: min(1180px, calc(100% - 88px)); margin-inline: auto; }
main { position: relative; overflow-anchor: none; }
.masthead { min-height: 70px; display: flex; align-items: center; justify-content: space-between; gap: 14px; color: var(--desk-text); }
.masthead a { font: 700 15px system-ui, sans-serif; text-decoration: none; }
.masthead a span { margin-right: 7px; color: #efab81; }
.masthead p, .eyebrow, .section-title, .folio, .plate-head, .navigation, footer { font: 700 11px/1.4 var(--mono); letter-spacing: .1em; }
.masthead p { text-transform: uppercase; }
.back-to-cover {
  border: 1px solid #eedec566;
  border-radius: 3px;
  background: transparent;
  color: var(--desk-text);
  padding: 8px 11px;
  font: 700 11px/1.4 var(--mono);
}
.back-to-cover:hover { background: #ffffff16; }
.book {
  display: grid;
  grid-template-columns: 44% 56%;
  min-height: 612px;
  position: relative;
  border-radius: 9px 9px 13px 13px;
  perspective: 1400px;
  box-shadow: 0 4px #d5c5a5, 0 7px #a1947b, 0 9px #d5c5a5, 0 13px 0 5px #5c3d2a, 0 30px 54px #0a1817b3;
  background: #e7d7ba;
}
.paper {
  position: relative;
  background-color: var(--paper);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='170' height='170'%3E%3Cfilter id='n'%3E%3CfeTurbulence baseFrequency='.74' numOctaves='3' seed='17' stitchTiles='stitch'/%3E%3C/filter%3E%3Cpath fill='%237e623b' opacity='.12' filter='url(%23n)' d='M0 0h170v170H0z'/%3E%3C/svg%3E"), var(--light);
}
.open-book {
  padding: 11px 15px;
  border: 1px solid #873127;
  border-radius: 3px;
  color: #fff5e4;
  background: #963b2e;
  font: 700 13px/1.4 system-ui,sans-serif;
  text-decoration: none;
}
.open-book span { margin-left: 8px; }
.open-book:hover { background: #762a20; }
.notes { --light: linear-gradient(90deg,#f6ecd8 85%,#d4c3a4); padding: 46px clamp(32px, 4vw, 58px) 43px; border-radius: 9px 2px 5px 10px; }
.plate { --light: linear-gradient(90deg,#dbc9a9 0%,#fbf2df 7%,#f3e6cd 97%,#e3d3b4); padding: 25px 27px 33px 31px; border-radius: 2px 9px 10px 5px; transform-origin: left; }
.plate.turn { animation: turn 370ms ease-out; }
@keyframes turn { 0% { transform: rotateY(-6deg); filter: brightness(.91); } 100% { transform: rotateY(0); filter: brightness(1); } }
.eyebrow, .section-title, .plate-head { color: #6c5143; }
h1 { font-size: clamp(44px, 5.8vw, 83px); letter-spacing: -.077em; line-height: .94; margin: 22px 0 9px; font-weight: 500; }
h1 span { color: var(--red); }
.subtitle { margin: 0 0 16px; color: var(--red); font: 700 clamp(23px,3vw,30px)/1.04 Caveat, Georgia, serif; }
.intro { font-size: clamp(15px, 1.35vw, 17px); margin: 0 0 22px; max-width: 37ch; }
.section-title { border-top: 1px solid #856c5a45; border-bottom: 1px solid #856c5a45; padding: 8px 0; display: flex; justify-content: space-between; gap: 8px; }
#discovery { color: var(--red); letter-spacing: .03em; }
.muscle-index { padding: 0; margin: 6px 0 0; list-style: none; }
.muscle-index button { width: 100%; padding: 5px 0; border: 0; background: transparent; display: grid; grid-template-columns: 22px 1fr; gap: 8px; text-align: left; }
.muscle-index button:hover strong, .muscle-index button[aria-pressed="true"] strong { color: var(--red); }
.muscle-index .tick { color: var(--red); font: 700 11px/1.9 var(--mono); font-variant-numeric: tabular-nums; }
.muscle-index strong { font-size: 15px; }
.muscle-index em { color: var(--soft-ink); font-size: 13px; display: block; line-height: 1.22; }
.folio { position: absolute; bottom: 12px; color: #6e594a; }
.notes .folio { left: 30px; }
.plate .folio { right: 28px; }
.plate-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.plate-head button { font: 600 11px/1.4 system-ui,sans-serif; padding: 6px 9px; border: 1px solid #876a564f; background: #fff9e85e; border-radius: 3px; }
.plate-head button:hover, .plate-head button[aria-pressed="true"] { color: var(--red); border-color: var(--red); }
.stage { --lift: 0; position: relative; isolation: isolate; overflow: clip; height: clamp(390px, 54vh, 540px); margin: 3px 0 5px; }
.stage::before {
  content: "";
  position: absolute;
  inset: 5px 2px;
  opacity: .55;
  background: linear-gradient(90deg, transparent 49.85%, #a48c753b 50%, transparent 50.15%),
    repeating-linear-gradient(0deg, transparent 0 28px, #a48c752b 28px 29px);
  mask-image: radial-gradient(ellipse, #000 24%, transparent 74%);
}
#skeleton, #cords, #handles { width: 100%; height: 100%; position: absolute; inset: 0; }
#plate-art, #cords, #handles { pointer-events: none; }
.stage:not([data-ready]) :is(#cords, #handles) { visibility: hidden; }
#plate-art {
  position: absolute;
  max-width: none;
  opacity: calc(1 - var(--model-mix, 0) * .84);
  mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent),
    linear-gradient(transparent, #000 1%, #000 98%, transparent);
  mask-composite: intersect;
}
#skeleton {
  opacity: var(--model-mix, 0);
  filter: drop-shadow(
    calc(var(--lift) * 10px) calc(var(--lift) * 15px) calc(var(--lift) * 5px)
    rgb(73 47 29 / calc(var(--lift) * .43))
  );
}
#open-illustration {
  position: absolute;
  inset: 0;
  width: 100%;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}
#open-illustration:focus-visible { outline-offset: -4px; }
#drawing-status {
  position: absolute;
  inset: 40% 24% auto;
  margin: 0;
  padding: 8px;
  background: var(--paper);
  color: var(--soft-ink);
  text-align: center;
}
#cords {
  filter: drop-shadow(
    calc(var(--lift) * 3px) calc(var(--lift) * 6px) calc(var(--lift) * 1px)
    rgb(83 46 29 / calc(var(--lift) * .37))
  );
}
#cords path { fill: none; stroke: #a54534; stroke-width: 1.7; }
#cords path.active { stroke: #822819; stroke-width: 3; }
#cords circle { fill: #a03c29; stroke: #f9e9d0; stroke-width: 1.2; }
.handle {
  position: absolute;
  min-width: 44px;
  min-height: 44px;
  padding: 2px 1px;
  display: grid;
  justify-items: center;
  align-content: center;
  background: transparent;
  border: 0;
  color: #963429;
  pointer-events: auto;
  touch-action: none;
  user-select: none;
  cursor: grab;
  transform: translate(-50%, -50%) translate(var(--dx,0px), var(--dy,0px));
}
.handle:active { cursor: grabbing; }
.handle span { position: absolute; bottom: 33px; width: max-content; font: 700 clamp(16px,1.85vw,24px)/.98 Caveat, Georgia, serif; max-width: 8ch; text-shadow: 0 1px #fff2d9; }
.handle svg { width: 31px; height: 22px; color: #603c2e; filter: drop-shadow(
  calc(var(--lift) * 3px) calc(var(--lift) * 5px) calc(var(--lift) * 1.5px)
  rgb(77 53 40 / calc(var(--lift) * .43))
); transform: rotate(calc(-12deg - var(--lift) * 7deg)); }
.bone-depth { opacity: var(--lift); }
.handle[aria-pressed="true"] svg, .handle:hover svg { color: var(--red); transform: rotate(-25deg) scale(1.13); }
#render-error { position: absolute; inset: 42% 27% auto; color: var(--soft-ink); background: var(--paper); text-align: center; }
.caption { min-height: 66px; border-top: 1px solid #856c5a45; display: grid; grid-template-columns: minmax(0,1fr) 128px; align-items: center; gap: 10px; padding-top: 6px; }
.caption-copy, .caption-actions { display: grid; }
.caption-text, .caption-actions > * { grid-area: 1 / 1; align-self: center; }
#interactive-book[data-view="live"] :is(.ink-caption, #open-book),
#interactive-book:not([data-view="live"]) :is(.live-caption, #pull-controls) { visibility: hidden; }
.caption p { margin: 0; }
.caption-heading { color: var(--red); font: 700 25px/1 Caveat, Georgia, serif; }
.caption-detail { font-size: 13px; color: var(--soft-ink); }
.pull-control { font: 700 10px/1.2 var(--mono); text-transform: uppercase; color: #6a5042; }
.pull-control input { width: 100%; display: block; margin: 8px 0 0; accent-color: var(--red); }
.pull-control input:disabled { opacity: .5; }
#exercise dl { margin: 24px 0; }
#exercise dt { margin-top: 14px; font-weight: 700; color: var(--red); }
#exercise dd { margin: 2px 0; font-size: 15px; }
.quiz { display: grid; gap: 15px; }
.quiz-right { padding: 43px 8px 14px; }
.quiz fieldset { margin: 0; padding: 8px 0 0; border: 0; border-top: 1px solid #856c5a45; }
.quiz legend { font-weight: 700; padding: 0 8px 0 0; }
.answers { display: flex; flex-wrap: wrap; gap: 5px; }
.answers button { padding: 5px 8px; border: 1px solid #856c5a70; border-radius: 3px; background: #fff9e875; font-size: 14px; }
.answers button:hover, .answers button[aria-pressed="true"] { border-color: var(--red); }
.answers .correct[aria-pressed="true"] { background: #365e45; color: white; border-color: #365e45; }
.answers .wrong[aria-pressed="true"] { background: var(--red); color: white; }
.feedback { min-height: 20px; margin: 4px 0 0; color: var(--soft-ink); font-size: 13px; }
.navigation { margin: 29px 0 15px; display: flex; justify-content: space-between; align-items: center; gap: 6px; color: var(--desk-text); }
.navigation button { min-height: 40px; padding: 5px 11px; background: transparent; border: 1px solid transparent; border-radius: 3px; }
.navigation button:hover:not(:disabled) { border-color: #e8d8bb80; }
.navigation button:disabled { opacity: .48; }
#chapters { display: flex; justify-content: center; flex-wrap: wrap; }
.navigation button[aria-current] { color: #fff4e0; background: #a63f32; }
footer, .notice { color: #e0d2b8; font-weight: 400; padding-bottom: 17px; }
footer a:hover { color: #fff; }
@media (max-width: 950px) {
  .masthead, main, footer { width: calc(100% - 38px); }
  .notes { padding-inline: 27px; }
  .plate { padding-inline: 17px; }
}
@media (max-width: 730px) {
  .masthead, main, footer { width: calc(100% - 26px); }
  .masthead { min-height: 51px; }
  .masthead p { font-size: 9px; }
  .book { display: flex; flex-direction: column; min-height: 0; }
  .notes { display: contents; }
  .book { background: var(--paper); border-radius: 8px; }
  h1 { font-size: clamp(46px, 12vw, 67px); }
  .notes > .eyebrow { padding: 19px 18px 0; order: 0; }
  .notes > h1 { margin: 9px 18px 1px; order: 1; }
  .notes > .subtitle { margin: 3px 18px 7px; order: 2; }
  .notes > .intro { margin: 0 18px 12px; font-size: 14px; max-width: none; order: 3; }
  .plate { order: 4; border-radius: 0; padding: 10px 12px 13px; }
  .plate-head { margin-inline: 6px; font-size: 9px; }
  .stage { height: clamp(328px, 97vw, 465px); }
  .open-book { padding: 7px; }
  .caption { margin-inline: 6px; grid-template-columns: minmax(0,1fr) 99px; }
  #index-panel, #exercise { order: 5; margin: 10px 18px 14px; }
  .muscle-index { display: grid; grid-template-columns: 1fr 1fr; column-gap: 9px; }
  .muscle-index button { min-height: 44px; gap: 2px; grid-template-columns: 18px 1fr; }
  .muscle-index strong { font-size: 13px; }
  .muscle-index em { font-size: 12px; }
  .folio { display: none; }
  #quiz-left { order: 3; margin: 5px 18px 13px; }
  .quiz-right { padding: 0 6px; }
  .navigation { flex-wrap: wrap; margin-top: 24px; }
  #chapters { order: -1; width: 100%; }
  #chapters button { padding-inline: 7px; }
}
@media (prefers-reduced-motion: reduce) { .plate.turn { animation: none; } }
