: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; }
footer { border-top: 1px solid var(--rule); margin-top: auto; padding: .65rem 0; }
footer nav { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 0 clamp(.8rem,2.5vw,2.4rem); }
footer a { display: inline-flex; align-items: center; min-height: 44px; font-size: .94rem; color: #d7ceb8; text-decoration: none; }
footer a:hover, footer a[aria-current] { text-decoration: underline; color: var(--gold); }
.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%;
}
.scene video:not([hidden]) { animation: follow-toss 1.88s linear both; }
@keyframes follow-toss {
  0%, 100% { top: -23%; }
  19%, 76% { top: -6%; }
  38%, 63% { top: 0; }
}
[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; }
  footer { padding: .4rem 0; }
  footer a { font-size: .88rem; }
}
