.history-section { padding-block:clamp(38px,4vw,60px); }
.history-section .section-head { align-items:baseline; margin-bottom:24px; }
.history-section .heading { display:flex; flex-direction:row-reverse; align-items:baseline; gap:20px; }
.history-section h2 { font-size:clamp(31px,3.2vw,50px); font-weight:580; }
.history-section .section-kicker { margin:0; font:italic clamp(19px,2vw,31px)/1.2 Baskerville,Georgia,serif; letter-spacing:-.03em; color:var(--muted); }
.history-layout { display:grid; grid-template-columns:minmax(205px,23%) minmax(0,1fr); gap:clamp(24px,3.7vw,60px); align-items:center; }
.history-menu label { display:block; font-size:var(--control-size); color:var(--text); padding-bottom:12px; }
.year-picker { display:none; }
.timeline { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:0 12px; }
.timeline button { display:flex; align-items:center; gap:8px; border:0; border-bottom:1px solid var(--line); background:transparent; padding:11px 0; min-height:44px; font-size:clamp(15px,1.16vw,19px); text-align:left; color:var(--muted); }
.timeline button span { width:6px; height:6px; border-radius:50%; background:#aaa; flex-shrink:0; }
.timeline button.selected { font-weight:700; color:var(--ink); border-bottom-color:var(--ink); }
.timeline button.selected span { background:var(--ink); }
.archive { position:relative; display:grid; align-items:center; grid-template-columns:minmax(0,1.9fr) minmax(180px,.75fr); isolation:isolate; padding:14px 0 22px 14px; }
.archive-deck { position:relative; min-width:0; }
.archive-deck::before,.archive-deck::after { content:""; position:absolute; inset:0; background:#e8e8e8; border:1px solid #d1d1d1; z-index:-1; }
.archive-deck::before { transform: translate(-6px,7px) rotate(-1.1deg); }
.archive-deck::after { transform: translate(-10px,12px) rotate(-1.9deg); z-index:-2; background:#f3f3f3; }
.archive-image { position:relative; overflow:hidden; background:#ebebeb; aspect-ratio:3 / 2; box-shadow:0 6px 18px #0002; }
.archive-image img { display:block; width:100%; height:100%; object-fit:contain; }
.archive-previous { position:absolute; inset:0; z-index:1; pointer-events:none; }
.zoom-image { position:absolute; z-index:3; top:12px; left:12px; display:grid; place-items:center; width:40px; height:40px; background:#fffffff2; color:var(--ink); border:0; padding:0; border-radius:50%; }
.archive-info { position:relative; z-index:2; align-self:end; margin:0 0 16px -39px; padding:22px 0 0 24px; background:var(--surface); box-shadow:-5px -5px 15px #00000009; }
#history-year { display:block; font:italic clamp(35px,4.4vw,82px)/1 Baskerville,Georgia,serif; letter-spacing:-.065em; overflow-wrap:anywhere; }
.archive-info h3 { font-size:clamp(19px,1.65vw,28px); line-height:1.4; font-weight:580; margin-top:9px; overflow-wrap:anywhere; }
.archive-progress { height:2px; margin:22px 0 10px; background:var(--line); }
.archive-progress i { display:block; height:100%; background:#323232; transform-origin:left; transform:scaleX(var(--archive-progress,.04)); transition:transform .45s var(--ease); }
.pager { display:flex; align-items:center; gap:5px; }
#slide-count { margin-right:auto; color:var(--muted); font:14px/1.2 ui-monospace,monospace; white-space:nowrap; }
.pager button { width:39px; height:39px; display:grid; place-items:center; background:#fff; color:var(--ink); border:1px solid #b8b8b8; border-radius:50%; transition:background .2s; }
.pager button:hover { background:var(--tint); }
#archive-dialog { border:0; padding:16px; max-width:95vw; max-height:94dvh; }
#archive-dialog::backdrop { background:#101010bb; }
.dialog-head { display:flex; align-items:center; justify-content:space-between; gap:15px; margin-bottom:12px; }
#dialog-image { max-height:calc(94dvh - 90px); width:auto; margin:auto; object-fit:contain; }
@media(max-width:1000px) and (min-width:701px) {
  .history-layout { grid-template-columns:175px 1fr; gap:20px; }
  .timeline { grid-template-columns:1fr; max-height:340px; overflow:auto; }
  .archive { grid-template-columns:minmax(0,1fr) 155px; }
  .archive-info { padding-left:14px; }
  .pager { flex-wrap:wrap; }
}
@media(max-width:700px) {
  .history-section .heading { gap:10px; }
  .history-section .section-head { flex-wrap:wrap; margin-bottom:15px; }
  .history-layout { display:block; }
  .timeline { display:none; }
  .history-menu { display:flex; align-items:center; gap:10px; }
  .history-menu label { padding:0; }
  .year-picker { display:block; }
  #year-select { width:100%; min-height:44px; border:1px solid var(--line); border-radius:4px; color:var(--ink); background:white; font-size:16px; }
  .archive { grid-template-columns:1fr; padding:20px 0 0 8px; }
  .archive-info { display:grid; grid-template-areas:"controls" "progress" "caption"; margin:-25px 0 0 6%; padding:10px 0 0 14px; }
  .archive-caption { grid-area:caption; display:flex; align-items:baseline; flex-wrap:wrap; gap:4px 13px; }
  #history-year { font-size:clamp(33px,8vw,50px); }
  .archive-info h3 { font-size:19px; margin:0; }
  .archive-progress { grid-area:progress; margin:8px 0 12px; }
  .pager { grid-area:controls; }
  .pager button,.zoom-image { min-height:44px; min-width:44px; }
}
.archive-image { touch-action:pan-y pinch-zoom; }
@media(max-width:480px) and (orientation:portrait) {
  .history-section .section-head .text-link, #close-dialog { min-height:44px; }
  #archive-dialog { padding:12px; }
  .dialog-head { gap:10px; }
}
