:root {
  color-scheme: dark;
  --forest: #061b0b;
  --ivory: #f5edd9;
  --gold: #dfbc73;
  --rule: #67704f;
  font-family: Georgia, 'Times New Roman', serif;
  color: var(--ivory);
  background: var(--forest);
}
* { box-sizing: border-box; }
body { margin: 0 auto; max-width: 100rem; min-height: 100vh; min-height: 100svh; padding: 0 clamp(1.25rem,4vw,4rem); display: flex; flex-direction: column; }
a { color: inherit; text-underline-offset: .2em; }
a:hover { color: var(--gold); }
a:focus-visible, button:focus-visible { outline: .18rem solid #ffe0a4; outline-offset: .25rem; }
.skip { position: absolute; left: .5rem; top: -5rem; background: var(--forest); z-index: 5; padding: .7rem; }
.skip:focus { top: .5rem; }
header { padding: 1.15rem 0 1rem; border-bottom: 1px solid var(--rule); }
header > a { text-decoration: none; font-size: clamp(1.8rem,3vw,2.6rem); letter-spacing: -.045em; }
header { display: flex; gap: 1.2rem; align-items: center; position: relative; z-index: 3; }
.site-menu { position: relative; }
.site-menu summary { display: flex; align-items: center; gap: .45rem; min-height: 44px; cursor: pointer; color: var(--gold); font-size: 1rem; list-style: none; }
.site-menu summary::-webkit-details-marker { display: none; }
.site-menu summary:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.site-menu nav { position: absolute; top: 100%; left: 0; width: 11.6rem; padding: .3rem; background: #102716; border: 1px solid var(--rule); border-radius: .3rem; box-shadow: 0 .5rem 1.5rem #0005; }
.site-menu nav a { display: flex; align-items: center; min-height: 44px; padding: .4rem .8rem; text-decoration: none; }
.site-menu nav a:is(:hover,:focus-visible,[aria-current]) { background: #233a27; color: var(--gold); }
.about-links { display: flex; gap: 1.5rem; margin-top: 1rem; }
.about-links a { display: inline-flex; min-height: 44px; align-items: center; }
.stage { display: grid; grid-template-columns: 36% 64%; align-items: center; flex: 1; position: relative; }
.controls { z-index: 1; padding: 2rem 0 2rem clamp(0rem,1.6vw,1.6rem); }
h1,h2,p,dl { margin: 0; }
h1,h2 { font-weight: normal; letter-spacing: -.045em; text-wrap: balance; }
.controls h1 { white-space: nowrap; font-size: clamp(3.6rem,7.4vw,8.3rem); line-height: 1.02; margin-bottom: clamp(1.4rem,4vh,2.6rem); }
#flip { color: #122311; font: inherit; font-size: clamp(1.25rem,2.2vw,2rem); border: 1px solid #d4ae5f; background: linear-gradient(115deg,#c39946,#dfbe79); border-radius: .25rem; padding: .66em 1.55em; cursor: pointer; }
#flip:hover { filter: brightness(1.06); }
#flip:active { transform: translateY(1px); }
#flip[aria-disabled=true] { cursor: progress; }
.tally { display: flex; margin-top: clamp(1.6rem,4vh,2.8rem); width: max-content; }
.tally div { min-width: 4.1rem; text-align: center; padding: 0 clamp(.65rem,1.5vw,1.6rem); font-size: 1rem; line-height: 1.35; }
.tally div + div { border-left: 1px solid var(--rule); }
.tally strong { display: block; font-size: clamp(1.65rem,2.8vw,2.65rem); font-weight: normal; font-variant-numeric: tabular-nums; }
#status { color: var(--gold); min-height: 1.7em; margin-top: .9rem; font-size: 1rem; }
.scene {
  position: relative;
  align-self: center;
  justify-self: start;
  width: min(100%, 87svh);
  aspect-ratio: 500 / 440;
  overflow: hidden;
}
/* The same camera window frames the ready pose, the toss and the catch.
   Lift the window during flight to leave headroom above the coin. */
.scene img,.scene video {
  position: absolute;
  width: 128%;
  height: auto;
  max-width: none;
  left: -21%;
  top: -23%;
}
[hidden] { display: none !important; }
.reading { width: min(100%,44rem); margin: 0 auto; padding: clamp(2.5rem,7vw,6rem) 0 4rem; }
.reading h1 { font-size: clamp(2.8rem,6vw,5.1rem); line-height: 1.02; margin-bottom: 1.3rem; }
.reading h2 { color: var(--gold); font-size: clamp(1.6rem,3vw,2.25rem); line-height: 1.15; margin: 2.4rem 0 .65rem; }
.reading p,.reading dd,.reading table { font-size: 1.12rem; line-height: 1.65; }
.reading p + p { margin-top: .9rem; }
.reading .lead { font-size: clamp(1.28rem,2.4vw,1.65rem); line-height: 1.45; color: #e8ddc5; }
.reading a { color: #e6c889; }
.reading .source { font-size: 1rem; }
table { margin: 1.25rem 0; border-collapse: collapse; width: 100%; }
caption { text-align: left; margin-bottom: .6rem; font-size: 1rem; }
th,td { text-align: left; padding: .45rem .6rem; border-bottom: 1px solid var(--rule); }
.guide dt { font-size: 1.2rem; margin-top: .9rem; }
.guide dd { margin: .2rem 0 0; }
@media(max-width: 670px) {
  header { padding: .85rem 0; }
  .stage { grid-template-columns: 1fr; grid-template-rows: auto auto; align-content: center; }
  .controls { padding: 1.3rem 0 0; text-align: center; }
  .controls h1 { font-size: clamp(2.9rem,10vw,4rem); margin-bottom: .8rem; }
  .tally { margin: 1rem auto 0; }
  #status { margin-top: .45rem; }
  .scene { width: min(100%, 27rem, 53svh); justify-self: center; }
  #status:empty { min-height: 0; }
}

html[data-hand]:not([data-hand="original"]) .scene { aspect-ratio: 520 / 490; }
html[data-hand]:not([data-hand="original"]) .scene :is(img,video) { inset: 0; width: 100%; height: 100%; }
.hand-picker { width: min(100%, 54rem); padding-block: clamp(1.75rem,4vw,3rem); }
.hand-picker h1 { margin-bottom: .45rem; }
.hand-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: clamp(.45rem,1.6vw,1rem); margin-top: 1.4rem; }
.hand-card { position: relative; overflow: hidden; border: 1px solid var(--rule); border-radius: .35rem; text-decoration: none; background: #05190b; }
.hand-card:is(:hover,[aria-current]) { border-color: var(--gold); }
.hand-card[aria-current]::after { content: '✓'; position: absolute; right: .4rem; top: .25rem; color: var(--gold); }
.hand-card img { display: block; width: 100%; height: auto; aspect-ratio: 1.65; object-fit: cover; object-position: center 60%; }
.hand-card span { display: block; padding: .65em .4em; text-align: center; border-top: 1px solid #334531; font-size: clamp(.88rem,2vw,1.2rem); }
