:root {
  --paper: #f3efe6;
  --paper-light: #faf8f2;
  --ink: #272722;
  --muted: #74736a;
  --line: #d8d2c4;
  --accent: #a5412f;
  --accent-dark: #7f2f22;
  --sage: #657365;
  --shadow: 0 18px 45px rgba(45, 38, 28, 0.13);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; overflow-x: hidden; color: var(--ink); background: var(--paper); font-family: "DM Sans", sans-serif; }
button, input { font: inherit; }
button { color: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }


.hero { position: relative; min-height: 520px; padding: 80px 24px 52px; overflow: visible; text-align: center; background: #e8e2d7; isolation: isolate; }
.hero::after { content: ""; z-index: -1; position: absolute; inset: 0; background: radial-gradient(ellipse at center, rgba(247,244,236,.84) 0%, rgba(243,239,230,.67) 42%, rgba(236,230,218,.48) 100%); }
.hero-content { position: relative; z-index: 2; }
.hero-collage { z-index: -2; position: absolute; inset: 0; overflow: hidden; opacity: .5; filter: grayscale(.28) sepia(.1) saturate(.82); }
.collage-tile { position: absolute; overflow: hidden; opacity: 1; background: #c8c0b2; box-shadow: 0 12px 35px rgba(47,39,28,.16); transform: rotate(var(--tile-rotation)); animation: collage-float var(--float-speed, 18s) ease-in-out infinite alternate; transition: opacity 4.2s cubic-bezier(.4,0,.2,1); will-change: transform, opacity; }
.collage-tile.collage-entering, .collage-tile.collage-leaving { opacity: 0; }
.collage-tile img { position: absolute; inset: -3%; width: 106%; height: 106%; object-fit: cover; opacity: 0; transform: scale(1.075); transition: opacity 2.8s cubic-bezier(.4,0,.2,1), transform 10s ease-out; will-change: opacity, transform; }
.collage-tile img.active { opacity: 1; transform: scale(1); }
.collage-tile-1 { --tile-rotation: -5deg; --float-x: 13px; --float-y: 10px; --float-turn: 1.3deg; --float-speed: 17s; left: -2%; top: 2%; width: 25%; height: 52%; animation-delay: -2s; }
.collage-tile-2 { --tile-rotation: 3deg; --float-x: -10px; --float-y: 14px; --float-turn: -1deg; --float-speed: 21s; left: 19%; top: -18%; width: 23%; height: 43%; animation-delay: -7s; }
.collage-tile-3 { --tile-rotation: -2deg; --float-x: 12px; --float-y: -11px; --float-turn: 1.5deg; --float-speed: 19s; right: 20%; top: -12%; width: 22%; height: 42%; animation-delay: -11s; }
.collage-tile-4 { --tile-rotation: 5deg; --float-x: -14px; --float-y: 9px; --float-turn: -1.2deg; --float-speed: 23s; right: -2%; top: 1%; width: 25%; height: 54%; animation-delay: -4s; }
.collage-tile-5 { --tile-rotation: 3deg; --float-x: 9px; --float-y: -13px; --float-turn: .9deg; --float-speed: 20s; left: 3%; bottom: -17%; width: 28%; height: 51%; animation-delay: -9s; }
.collage-tile-6 { --tile-rotation: -3deg; --float-x: -12px; --float-y: -8px; --float-turn: -1.4deg; --float-speed: 18s; right: 3%; bottom: -17%; width: 28%; height: 50%; animation-delay: -13s; }
.collage-tile-7 { --tile-rotation: 1deg; --float-x: 10px; --float-y: 12px; --float-turn: 1deg; --float-speed: 22s; left: 38%; bottom: -27%; width: 24%; height: 43%; animation-delay: -5s; }
@keyframes collage-float {
  0% { transform: translate3d(0, 0, 0) rotate(calc(var(--tile-rotation) - var(--float-turn))) scale(.99); }
  45% { transform: translate3d(3px, -4px, 0) rotate(var(--tile-rotation)) scale(1.012); }
  100% { transform: translate3d(var(--float-x), var(--float-y), 0) rotate(calc(var(--tile-rotation) + var(--float-turn))) scale(1); }
}
.eyebrow { margin: 0 0 14px; color: var(--accent); font-size: 11px; font-weight: 600; letter-spacing: .17em; text-transform: uppercase; }
h1 { margin: 0; font: 500 clamp(46px, 6vw, 76px)/.98 "Newsreader", serif; letter-spacing: -.045em; }
.hero-copy { max-width: 610px; margin: 20px auto 31px; color: var(--muted); font: 19px/1.5 "Newsreader", serif; }
.search-box { width: min(680px, 100%); height: 58px; margin: 0 auto; padding: 0 17px; display: flex; align-items: center; gap: 13px; background: var(--paper-light); border: 1px solid #cbc4b5; box-shadow: 0 7px 22px rgba(55,45,31,.08); transition: border .2s, box-shadow .2s; }
.search-box:focus-within { border-color: var(--accent); box-shadow: 0 8px 24px rgba(88,45,30,.14); }
.search-box svg { width: 21px; fill: none; stroke: var(--muted); stroke-width: 1.7; }
.search-box input { flex: 1; min-width: 0; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 16px; }
.search-box input::placeholder { color: #999589; }
kbd { padding: 4px 7px; color: var(--muted); background: #ece7dc; border: 1px solid #d9d2c4; border-radius: 3px; font: 11px "DM Sans", sans-serif; }

.quick-filters { position: relative; z-index: 2; width: min(940px, 100%); margin: 15px auto 0; display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px; }
.material-filter { display: flex; gap: 7px; margin: 0; padding: 0; border: 0; }
.material-filter label { position: relative; display: flex; align-items: center; cursor: pointer; }
.material-filter input { position: absolute; opacity: 0; pointer-events: none; }
.material-filter label span, .decade-filters button { display: inline-flex; align-items: center; height: 34px; padding: 0 12px; color: #56554e; background: rgba(250,248,242,.82); border: 1px solid rgba(116,108,94,.3); border-radius: 18px; box-shadow: 0 2px 8px rgba(55,45,31,.04); cursor: pointer; font-size: 11px; transition: color .2s, background .2s, border .2s, transform .2s; }
.material-filter label span { padding-right: 30px; }
.material-filter label:hover span, .decade-filters button:hover { transform: translateY(-1px); border-color: rgba(83,74,61,.52); }
.material-filter input:checked + span, .decade-filters button.active { color: white; background: var(--accent); border-color: var(--accent); }
.material-filter output { position: absolute; right: 10px; color: #999589; font-size: 9px; pointer-events: none; }
.material-filter input:checked ~ output { color: rgba(255,255,255,.75); }
.decade-filters { display: flex; flex-wrap: wrap; justify-content: center; gap: 7px; }
.decade-filters button { margin: 0; }
.filter-divider { width: 1px; height: 22px; margin: 0 3px; background: rgba(75,69,60,.22); }
.people-filter { position: relative; }
.people-filter summary { display: flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; color: #56554e; background: rgba(250,248,242,.82); border: 1px solid rgba(116,108,94,.3); border-radius: 18px; cursor: pointer; font-size: 11px; list-style: none; }
.people-filter summary::-webkit-details-marker { display: none; }
.people-filter summary::after { content: "⌄"; margin-left: 2px; color: var(--muted); }
.people-filter[open] summary { color: white; background: var(--accent); border-color: var(--accent); }
.people-filter[open] summary::after { color: white; }
#person-filter-count:not(:empty) { display: grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; color: var(--accent-dark); background: white; border-radius: 10px; font-size: 9px; }
.people-menu { z-index: 20; position: absolute; top: 42px; right: 0; width: 270px; padding: 10px; text-align: left; background: var(--paper-light); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); }
.people-menu > input { width: 100%; height: 36px; padding: 0 11px; color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: 6px; outline: 0; font-size: 12px; }
.people-menu > input:focus { border-color: var(--accent); }
.person-options { max-height: 250px; margin-top: 8px; overflow-y: auto; overscroll-behavior: contain; }
.person-options label { display: flex; align-items: center; gap: 9px; min-height: 34px; padding: 5px 7px; border-radius: 5px; cursor: pointer; font-size: 12px; }
.person-options label:hover { background: #eee8dc; }
.person-options input { accent-color: var(--accent); }
.clear-filters { height: 32px; padding: 0 8px; color: var(--accent-dark); background: transparent; border: 0; cursor: pointer; font-size: 10px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.collection-summary { position: relative; z-index: 2; display: flex; align-items: center; justify-content: center; gap: 9px; margin-top: 13px; color: #77736b; font: 12px "Newsreader", serif; }
.collection-summary i { width: 3px; height: 3px; background: var(--accent); border-radius: 50%; }
.archive-shell { max-width: 1220px; margin: 0 auto; padding: 42px 30px 100px; border-top: 1px solid var(--line); }

.results-toolbar { display: flex; align-items: center; justify-content: space-between; height: 35px; margin-bottom: 22px; }
.results-toolbar p { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .1em; }
.results-toolbar strong { color: var(--ink); }
.view-toggle { display: flex; gap: 3px; }
.view-toggle button { padding: 6px 9px; color: var(--muted); background: transparent; border: 0; cursor: pointer; font-size: 11px; }
.view-toggle button.active { color: var(--paper-light); background: var(--ink); }
.active-filters { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 14px; }
.active-filters:empty { display: none; }
.active-filters button { padding: 5px 9px; color: var(--accent-dark); background: #eadbd2; border: 0; border-radius: 20px; cursor: pointer; font-size: 11px; }

.timeline { position: relative; }
.timeline .will-reveal { opacity: 0; transform: translate3d(var(--reveal-x, 0), var(--reveal-y, 20px), 0) rotate(var(--reveal-rotation, 0deg)) scale(var(--reveal-scale, 1)); transition: opacity var(--reveal-duration, 800ms) cubic-bezier(.2,.72,.2,1), transform var(--reveal-duration, 900ms) cubic-bezier(.16,1,.3,1), filter var(--reveal-duration, 800ms) ease; transition-delay: var(--reveal-delay, 0ms); filter: blur(3px); }
.timeline .will-reveal.revealed { opacity: 1; transform: translate3d(0, 0, 0) rotate(0); filter: blur(0); }
.timeline:not(.grid)::before { content: ""; position: absolute; top: 8px; bottom: 0; left: 85px; width: 1px; background: var(--line); }
.year-heading { position: relative; display: grid; grid-template-columns: 64px 44px 1fr; align-items: center; min-height: 58px; }
.year-heading strong { font: 500 31px "Newsreader", serif; }
.year-heading i { z-index: 1; justify-self: center; width: 9px; height: 9px; background: var(--accent); border: 3px solid var(--paper); border-radius: 50%; box-shadow: 0 0 0 1px var(--accent); }
.timeline-card { position: relative; display: grid; grid-template-columns: 64px 44px minmax(0, 1fr); margin-bottom: 26px; }
.sequence { padding-top: 16px; color: #aaa598; font: 11px "Newsreader", serif; text-align: right; }
.node { z-index: 1; justify-self: center; width: 7px; height: 7px; margin-top: 20px; background: var(--paper); border: 1.5px solid var(--sage); border-radius: 50%; }
.card-inner { display: grid; grid-template-columns: minmax(210px, 37%) 1fr; min-height: 224px; overflow: hidden; background: rgba(250,248,242,.72); border: 1px solid var(--line); cursor: pointer; transition: transform .25s, box-shadow .25s, background .25s; }
.card-inner:hover { transform: translateY(-3px); background: var(--paper-light); box-shadow: var(--shadow); }
.card-image { position: relative; min-height: 224px; overflow: hidden; background: #d8d1c3; }
.card-image img { width: 100%; height: 100%; position: absolute; object-fit: cover; filter: saturate(.82) contrast(.96); transition: transform .5s; }
.card-inner:hover img { transform: scale(1.025); }
.card-inner.photo-only { display: block; min-height: 340px; background: #d8d1c3; }
.card-inner.photo-only .card-image { height: 100%; min-height: 340px; }
.card-inner.photo-only img { object-fit: contain; background: #ded8cc; }
.photo-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: 16px; margin: 0 0 28px 108px; }
.photo-strip .timeline-card { display: block; min-width: 0; margin: 0; }
.photo-strip .sequence, .photo-strip .node { display: none; }
.photo-strip .card-inner.photo-only, .photo-strip .card-inner.photo-only .card-image { min-height: 260px; }
.card-body { display: flex; flex-direction: column; padding: 24px 27px 21px; }
.date { margin-bottom: 9px; color: var(--accent); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .1em; }
.card-body h2 { margin: 0 0 11px; font: 500 clamp(21px, 2vw, 28px)/1.08 "Newsreader", serif; letter-spacing: -.02em; }
.summary { display: -webkit-box; overflow: hidden; margin: 0 0 18px; color: #626158; font: 14px/1.5 "Newsreader", serif; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; }
.tags span { padding: 4px 7px; color: #626158; background: #ebe6dc; font-size: 9px; letter-spacing: .04em; }

.timeline.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.timeline.grid .photo-strip { display: contents; }
.grid .year-heading { grid-column: 1 / -1; display: block; min-height: auto; padding: 22px 0 3px; border-bottom: 1px solid var(--line); }
.grid .year-heading i, .grid .sequence, .grid .node { display: none; }
.grid .timeline-card { display: block; margin: 0; }
.grid .card-inner { grid-template-columns: 1fr; height: 100%; }
.grid .card-image { min-height: 255px; }
.grid .card-inner.photo-only, .grid .card-inner.photo-only .card-image { min-height: 330px; }

.empty { padding: 80px 20px; text-align: center; border: 1px solid var(--line); }
.empty span { font: 500 30px "Newsreader", serif; }
.empty p { color: var(--muted); }

dialog { padding: 0; color: var(--ink); background: var(--paper-light); border: 0; box-shadow: 0 24px 80px rgba(27,23,17,.3); }
dialog::backdrop { background: rgba(34,31,26,.7); backdrop-filter: blur(3px); }
.viewer { width: min(1160px, calc(100vw - 38px)); max-height: calc(100vh - 38px); }
.viewer-close { z-index: 4; position: absolute; top: 14px; right: 17px; display: grid; place-items: center; width: 35px; height: 35px; color: var(--paper-light); background: rgba(31,30,27,.75); border: 0; border-radius: 50%; cursor: pointer; font: 25px/1 sans-serif; }
.viewer-nav { z-index: 5; position: fixed; top: 50%; display: flex; align-items: center; gap: 7px; padding: 11px 13px; translate: 0 -50%; color: var(--paper-light); background: rgba(31,30,27,.82); border: 1px solid rgba(255,255,255,.18); border-radius: 24px; box-shadow: 0 8px 25px rgba(0,0,0,.2); backdrop-filter: blur(8px); cursor: pointer; font-size: 12px; }
.viewer-prev { left: max(10px, calc((100vw - min(1160px, 100vw - 38px)) / 2 - 64px)); }
.viewer-next { right: max(10px, calc((100vw - min(1160px, 100vw - 38px)) / 2 - 64px)); }
.viewer-nav:disabled { opacity: .25; cursor: default; }
.viewer-nav:not(:disabled):hover { background: var(--accent-dark); }
.viewer-layout { display: grid; grid-template-columns: minmax(0, 52%) 1fr; min-height: 72vh; }
.viewer-layout.is-landscape { grid-template-columns: 1fr; }
.viewer-layout.is-landscape .viewer-image { width: 100%; min-height: 56vh; height: 56vh; }
.viewer-layout.is-landscape .viewer-image img { max-height: calc(56vh - 64px); }
.viewer-layout.is-landscape .viewer-copy { max-height: none; padding: 42px clamp(28px, 7vw, 90px) 58px; }
.viewer-image { display: grid; place-items: center; min-height: 72vh; padding: 32px; background: #272621; }
.viewer-image img { max-width: 100%; max-height: calc(100vh - 104px); object-fit: contain; box-shadow: 0 10px 35px rgba(0,0,0,.35); }
.zoom-stage { position: relative; overflow: hidden; cursor: zoom-in; touch-action: none; }
.zoom-stage .zoomable-image { transform-origin: center; transition: transform .45s cubic-bezier(.22,1,.36,1); will-change: transform; }
.zoom-stage.is-zoomed { cursor: grab; }
.zoom-stage.is-dragging { cursor: grabbing; }
.zoom-stage.is-dragging .zoomable-image { transition: none; }
.zoom-controls { z-index: 2; position: absolute; left: 50%; bottom: 18px; display: flex; overflow: hidden; translate: -50% 0; background: rgba(26,25,22,.84); border: 1px solid rgba(255,255,255,.18); border-radius: 24px; backdrop-filter: blur(8px); }
.zoom-controls button { min-width: 38px; height: 36px; padding: 0 11px; color: #f7f4ec; background: transparent; border: 0; border-right: 1px solid rgba(255,255,255,.14); cursor: pointer; font-size: 14px; }
.zoom-controls button:last-child { border-right: 0; }
.zoom-controls button:hover { background: rgba(255,255,255,.12); }
.zoom-hint { z-index: 2; position: absolute; top: 17px; left: 50%; padding: 6px 10px; translate: -50% 0; color: rgba(255,255,255,.72); background: rgba(26,25,22,.62); border-radius: 20px; font-size: 10px; letter-spacing: .04em; pointer-events: none; transition: opacity .3s; }
.zoom-stage.is-zoomed .zoom-hint { opacity: 0; }
.viewer-image-only { min-height: min(88vh, 900px); }
.viewer-copy { max-height: calc(100vh - 38px); overflow-y: auto; padding: 52px 44px; }
.viewer-copy h2 { margin: 0 0 12px; font: 500 38px/1.05 "Newsreader", serif; }
.viewer-lead { color: #626158; font: 17px/1.55 "Newsreader", serif; }
.viewer-meta { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin: 28px 0; padding: 20px 0; border-block: 1px solid var(--line); }
.viewer-meta span { display: block; margin-bottom: 4px; color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .12em; }
.viewer-meta strong { font: 500 15px "Newsreader", serif; }
.transcription-heading { margin: 28px 0 10px; font: 600 18px "Newsreader", serif; }
.transcription { white-space: pre-wrap; color: #4d4c45; font: 14px/1.65 "Newsreader", serif; }
.source-link { display: inline-block; margin-top: 25px; color: var(--accent-dark); font-size: 12px; }
@media (max-width: 850px) {
  .archive-shell { padding-inline: 18px; }
  .photo-strip { margin-left: 27px; }
  .viewer-layout { grid-template-columns: 1fr; }
  .viewer-image { min-height: 45vh; }
  .viewer-copy { max-height: none; padding: 36px 25px; }
  .viewer-nav { top: auto; bottom: 10px; translate: none; }
  .viewer-prev { left: 12px; }
  .viewer-next { right: 12px; }
  .viewer-nav span { display: none; }
}

@media (max-width: 590px) {
  .hero { min-height: 500px; padding: 68px 18px 42px; }
  .hero-collage { opacity: .4; }
  .collage-tile-1, .collage-tile-4 { width: 42%; }
  .collage-tile-5, .collage-tile-6 { width: 44%; }
  .hero-copy { font-size: 17px; }
  .quick-filters { gap: 7px; }
  .filter-divider { display: none; }
  .material-filter, .decade-filters { width: 100%; justify-content: center; }
  kbd { display: none; }
  .archive-shell { width: 100%; padding-inline: 12px; }
  .results { min-width: 0; }
  .timeline:not(.grid)::before { display: none; }
  .year-heading { display: block; min-height: auto; padding: 26px 0 12px; }
  .year-heading i { display: none; }
  .timeline-card { display: block; width: 100%; }
  .sequence, .node { display: none; }
  .card-inner { grid-template-columns: 1fr; }
  .card-image { min-height: 230px; }
  .timeline.grid { grid-template-columns: 1fr; }
  .photo-strip { grid-template-columns: repeat(auto-fit, minmax(min(190px, 100%), 1fr)); width: 100%; margin-left: 0; }
  .people-menu { position: fixed; top: 50%; right: 16px; left: 16px; width: auto; max-height: 70vh; translate: 0 -50%; }
  .person-options { max-height: calc(70vh - 70px); }
  .viewer { width: calc(100vw - 16px); max-height: calc(100vh - 16px); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .timeline .will-reveal,
  .timeline .year-heading.will-reveal { opacity: 1; transform: none; filter: none; transition: none; }
  .collage-tile { animation: none; }
  .collage-tile img { transition: none; }
}
