:root {
  color-scheme: light;
  --paper: #f5f1e7;
  --ink: #292a23;
  --line: #cdc7b9;
  --wine: #663346;
  --frame: #252922;
  font: 100% Arial, Helvetica, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); }
header, main, footer { width: min(1120px, 90%); margin: auto; }
header, footer { display: flex; justify-content: space-between; align-items: center; gap: 1em; padding: 1.3rem 0; font-size: .93rem; }
header { border-bottom: 1px solid var(--line); }
header nav a, footer a:first-child { font-weight: bold; }
nav span { color: #776d5b; margin: 0 .3em; }
a { color: inherit; text-underline-offset: .2em; }
button, input, select { font: inherit; }
button, select, input[type=range], .modes label { cursor: pointer; }
:focus-visible { outline: 3px solid #a64453; outline-offset: 3px; }
.skip { position: absolute; left: 1em; top: -6em; background: white; padding: .6em; }
.skip:focus { top: .4em; z-index: 1; }
[hidden] { display: none !important; }
h1, h2, h3 { font-family: Georgia, 'Times New Roman', serif; font-weight: normal; margin: 0; }
.intro { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; padding: clamp(1.6rem, 4vw, 3.4rem) 0; }
h1 { font-size: clamp(3.9rem, 7.3vw, 6.6rem); line-height: .95; letter-spacing: -.065em; }
h1 em { font-weight: normal; color: var(--wine); }
p { line-height: 1.55; }
.intro p { max-width: 32rem; margin: 0; color: #504f44; }
#viewer { display: grid; grid-template-columns: minmax(0, 1.57fr) minmax(235px, 1fr); background: #fffdf7; border: 1px solid #a49e8e; }
.scan-frame { background: var(--frame); display: flex; flex-direction: column; justify-content: center; padding: 1.05rem clamp(1.25rem, 4vw, 3.4rem) 1.1rem; }
.plate-label, .frame-foot { display: flex; justify-content: space-between; gap: 10px; color: #e3d2ab; font: .75rem/1.4 ui-monospace, monospace; }
.plate-label { padding-bottom: .85rem; letter-spacing: .09em; text-transform: uppercase; }
.compare-strip { display: flex; align-items: center; gap: .85rem; margin-top: .75rem; }
.compare-strip #hold { width: auto; flex-shrink: 0; color: var(--ink); border-color: #e3d2ab; background: #e3d2ab; }
.compare-strip #hold:active { background: #fff0c3; }
.compare-strip .hint { color: #eee5d0; margin: 0; font-size: .8rem; }
.frame-foot { padding-top: .75rem; border-top: 1px solid #827d66; margin-top: .5rem; }
#plate { display: block; margin: 0 auto; width: 100%; height: auto; aspect-ratio: 332 / 280; background: #36382e; cursor: grab; touch-action: none; box-shadow: 0 0 0 1px #a7a18e; }
#plate:active { cursor: grabbing; }
#plate:focus-visible { outline-color: #f6cb60; }
.controls { padding: clamp(1.1rem, 2.6vw, 2.25rem); align-self: center; }
.controls > label, legend, .axis label { font-weight: bold; font-size: .9rem; }
select, #hold { width: 100%; min-height: 44px; border: 1px solid #9f9b8e; border-radius: 3px; }
select { display: block; margin-top: .45rem; padding: .5rem; color: var(--ink); background: #fffdf7; }
fieldset { border: 0; margin: 1.2rem 0 .7rem; padding: 0; }
legend { padding: 0; margin-bottom: .45rem; }
.modes { display: flex; gap: 0; border: 1px solid #a49e8e; border-radius: 3px; }
.modes label { position: relative; flex: 1; text-align: center; }
.modes label + label { border-left: 1px solid #a49e8e; }
.modes input { position: absolute; opacity: 0; }
.modes span { display: grid; place-items: center; min-height: 42px; }
.modes input:checked + span { background: #e2d1ab; color: #28251c; font-weight: bold; }
.modes input:focus-visible + span { outline: 3px solid #a64453; outline-offset: -4px; }
#hold { font-weight: bold; background: var(--frame); border-color: var(--frame); color: #fffdf7; padding: .5rem 1rem; user-select: none; touch-action: none; }
#hold:active { background: #4b4e40; }
.hint { font-size: .855rem; color: #565449; margin: .4rem 0 .8rem; line-height: 1.45; }
.alignment { border-top: 1px solid var(--line); padding-top: .65rem; margin-top: 1.05rem; display: flex; justify-content: space-between; align-items: center; gap: .4rem; }
.alignment h2 { font-size: 1.4rem; }
#reset { min-height: 44px; padding: 0 .2em; border: 0; background: none; color: var(--wine); text-decoration: underline; text-underline-offset: .2em; }
.axis { display: grid; grid-template-columns: 1fr auto; align-items: center; column-gap: .5rem; }
.axis label { font-size: .82rem; }
.axis output { font: .83rem ui-monospace, monospace; }
.axis input { grid-column: 1/-1; width: 100%; height: 32px; margin: 0; accent-color: #673b46; }
.axis + .axis { margin-top: .25rem; }
.landmark { grid-column: 1/-1; margin: 0; padding: .85rem 1.3rem; background: #e8e1cf; font-size: .94rem; border-top: 1px solid #bfb59e; }
#sources { padding: clamp(2.2rem, 5vw, 4rem) 0 1.5rem; }
#sources h2 { font-size: clamp(2.15rem, 4vw, 3.1rem); letter-spacing: -.045em; }
#sources > p { max-width: 76ch; }
.sources-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2rem; margin: 1.6rem 0; }
figure { margin: 0; }
figure img { display: block; width: 100%; height: auto; }
figcaption { padding: .85rem 0; }
figcaption h3 { font-size: 1.5rem; }
figcaption p { margin: .5rem 0; }
.identifier { font: .78rem ui-monospace, monospace; color: #625d4f; }
figcaption > a { font-size: .9rem; }
footer { border-top: 1px solid var(--line); }
.notice { padding: 1rem; border: 1px solid var(--line); }
@media (max-width: 720px) {
  header, main, footer { width: 92%; }
  .intro { display: block; }
  .intro p { margin-top: 1rem; }
  #viewer, .sources-grid { grid-template-columns: minmax(0, 1fr); }
  .scan-frame { padding: .85rem 1.1rem; }
  .controls { padding: 1.1rem; }
  .compare-strip { gap: .6rem; }
  .compare-strip #hold { max-width: 53%; }
  .landmark { grid-row: 2; }
  .sources-grid { gap: 1rem; }
  header, footer { font-size: .85rem; }
}
