:root {
  --paper: #f9eee3;
  --card: #fffaf4;
  --ink: #183e40;
  --teal: #1a4c4d;
  --muted: #536c69;
  --line: #dbcec2;
  --pink: #e4a1ad;
  --apricot: #f5a061;
  --gutter: clamp(16px, 4vw, 68px);
  color-scheme: light;
  font-family: "Open Sans", system-ui, sans-serif;
}
@font-face {
  font-family: "Open Sans";
  src: url("assets/fonts/open-sans-regular.woff") format("woff");
  font-weight: 400 500;
  font-display: swap;
}
@font-face {
  font-family: "Open Sans";
  src: url("assets/fonts/open-sans-bold.woff") format("woff");
  font-weight: 600 900;
  font-display: swap;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--paper); color: var(--ink); }
button, input, select { font: inherit; }
button, select { cursor: pointer; }
button { color: inherit; }
button:disabled { cursor: default; opacity: .45; }
:focus-visible { outline: 2px solid #a7435c; outline-offset: 3px; }
.shell { max-width: 1776px; margin-inline: auto; padding-inline: var(--gutter); }
.sr-only, .skip-link:not(:focus) {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.skip-link:focus {
  position: fixed;
  z-index: 5;
  top: 12px;
  left: 12px;
  background: var(--card);
  padding: 12px;
}
.masthead {
  position: relative;
  overflow: hidden;
  background: #fff3e8;
  border-bottom: 1px solid var(--line);
}
.masthead-inner { position: relative; padding-block: clamp(34px, 5.3vw, 82px) clamp(38px, 5.1vw, 75px); }
.brand { margin: 0 0 12px; font-size: clamp(19px, 2.15vw, 31px); font-weight: 800; letter-spacing: -.065em; }
h1 { margin: 0; font-size: clamp(32px, 5.45vw, 96px); line-height: 1.02; letter-spacing: -.073em; }
.sweep { position: absolute; inset: 0; overflow: hidden; }
.sweep i {
  position: absolute;
  right: -9%;
  bottom: -18%;
  width: 48%;
  height: 114%;
  border-radius: 100% 0 0 0;
  transform: rotate(-7deg);
  transform-origin: bottom right;
  background: var(--pink);
}
.sweep i:nth-child(2) { width: 45%; height: 84%; background: var(--teal); }
.sweep i:nth-child(3) { width: 42%; height: 51%; background: var(--apricot); }
.toolbar {
  position: sticky;
  z-index: 2;
  top: 0;
  border-bottom: 1px solid var(--line);
  background: #f9eee3;
}
.tools, .controls, .series-tabs, .density { display: flex; align-items: center; }
.tools { min-height: 77px; gap: 12px 23px; justify-content: space-between; padding-block: 13px; flex-wrap: wrap; }
.series-tabs, .density { margin: 0; padding: 3px; border: 1px solid var(--line); border-radius: 9px; gap: 2px; min-inline-size: 0; }
.controls { gap: 9px; flex-wrap: wrap; }
.toolbar button, .search input, .section select { min-height: 36px; padding: 7px 10px; font-size: 13px; }
.toolbar button { border: 0; background: transparent; border-radius: 6px; font-weight: 650; white-space: nowrap; }
.toolbar button:hover { background: #f0e1d5; }
.toolbar button[aria-pressed="true"] { background: var(--teal); color: white; }
#saved-count:empty { display: none; }
#saved-count { display: inline; margin-left: 2px; font-size: 11px; }
.search input, .section select {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  color: var(--ink);
}
.search input { width: 166px; }
.search input::placeholder { opacity: 1; color: var(--muted); }
.section select { width: 162px; }
.density button { min-width: 33px; padding-inline: 5px; font-variant-numeric: tabular-nums; }
.density-label { color: var(--muted); margin-inline: 5px 3px; font-size: 11px; }
.collection { scroll-margin-top: 152px; padding-block: 19px 50px; }
.result-count { margin: 0 0 13px; font-size: 13px; font-weight: 650; color: var(--muted); }
.gallery-grid {
  --gap: clamp(8px, 1.05vw, 18px);
  display: grid;
  grid-template-columns: repeat(var(--columns, 4), minmax(0, 1fr));
  gap: var(--gap);
}
.card {
  position: relative;
  overflow: clip;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  min-width: 0;
}
.card:hover { border-color: #aa8f86; }
.card-open { display: block; width: 100%; padding: 0; background: transparent; border: 0; text-align: left; }
.card-open:focus-visible { position: relative; outline-offset: -3px; z-index: 1; }
.thumb { display: block; aspect-ratio: 2 / 1; overflow: hidden; background: #fffaf4; }
.thumb img { display: block; width: 100%; height: 100%; object-fit: contain; }
.caption { display: flex; align-items: center; height: 40px; padding-inline: 11px 36px; gap: 8px; border-top: 1px solid #eaded2; }
.no { flex: none; color: var(--muted); font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; }
.caption-title { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 12px; font-weight: 650; }
.save { position: absolute; right: 4px; bottom: 3px; background: transparent; border: 0; width: 32px; height: 34px; border-radius: 7px; font-size: 21px; line-height: 1; }
.save:hover, .save[aria-pressed="true"] { color: #813e4e; background: #f5dbe0; }
[data-density="10"] .gallery-grid { --gap: clamp(3px, .6vw, 10px); }
[data-density="6"] .card, [data-density="10"] .card { border-radius: 6px; }
[data-density="10"] .caption { height: 25px; padding: 0 5px; }
[data-density="10"] .caption-title { display: none; }
[data-density="10"] .save { height: 23px; width: 24px; right: 1px; bottom: 1px; font-size: 16px; }
.empty { padding: 28px 0; }
.empty p { margin: 0 0 12px; }
.empty button, .viewer-nav button, .viewer-save, .icon-button {
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 42px;
  padding: 7px 12px;
  background: var(--card);
  font-size: 13px;
  font-weight: 650;
}
.empty button:hover, .viewer-nav button:not(:disabled):hover, .viewer-save:hover, .icon-button:hover { background: #f7e3da; }
body:has(dialog[open]) { overflow: hidden; }
dialog {
  color: var(--ink);
  background: var(--paper);
  width: min(920px, calc(100% - 28px));
  max-height: calc(100dvh - 28px);
  padding: 13px 20px 16px;
  border-radius: 17px;
  border: 1px solid var(--line);
  box-shadow: 0 14px 56px #152c2d42;
  overscroll-behavior: contain;
}
dialog::backdrop { background: #0c292acc; }
.viewer-top, .viewer-info, .viewer-nav { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.viewer-top { padding: 0 0 9px; color: var(--muted); font-size: 13px; }
.icon-button { width: 42px; padding: 0; font-size: 24px; }
.viewer-art { display: grid; place-items: center; height: min(56vh, 468px); background: var(--card); border-radius: 10px; border: 1px solid var(--line); overflow: hidden; }
.viewer-art img { width: 100%; height: 100%; min-height: 0; object-fit: contain; }
.viewer-info { padding-block: 14px; align-items: flex-start; }
.viewer-info h2 { margin: 0 0 3px; font-size: clamp(18px, 2.5vw, 26px); line-height: 1.15; letter-spacing: -.035em; }
.viewer-info p { margin: 0; font-size: 13px; color: var(--muted); }
.viewer-save { flex-shrink: 0; }
.viewer-save[aria-pressed="true"] { background: #f5dbe0; border-color: #dcacb5; }
.viewer-nav { border-top: 1px solid var(--line); padding-top: 11px; }
.viewer-nav button:first-child, .viewer-nav button:last-child { min-width: 46px; font-size: 18px; }
@media (min-width: 1400px) {
  .collection { scroll-margin-top: 91px; }
}
@media (max-width: 650px) {
  .masthead-inner { padding-block: 27px 34px; }
  .masthead h1 { max-width: 79%; font-size: clamp(34px, 8.9vw, 53px); }
  .brand { margin-bottom: 9px; }
  .sweep i { right: -14%; width: 44%; height: 90%; }
  .sweep i:nth-child(2) { width: 41%; height: 71%; }
  .sweep i:nth-child(3) { width: 39%; height: 47%; }
  .tools { align-items: flex-start; gap: 8px; padding-block: 9px; }
  .series-tabs { max-width: 100%; }
  .series-tabs button { padding-inline: 7px; font-size: 11px; }
  .controls { gap: 6px; width: 100%; }
  .search, .section { flex: 1 1 130px; min-width: 0; }
  .search input, .section select { width: 100%; padding-inline: 8px; min-height: 38px; }
  .density button { min-height: 33px; min-width: 31px; }
  .collection { padding-block: 13px 38px; scroll-margin-top: 160px; }
  .gallery-grid { --gap: 6px; }
  .caption { height: 35px; padding-left: 8px; gap: 5px; }
  .caption-title { font-size: 11px; }
  .save { bottom: 1px; right: 2px; }
  [data-density="4"] .caption { padding: 0 2px; justify-content: center; }
  [data-density="4"] .caption-title, [data-density="4"] .save,
  [data-density="6"] .caption-title, [data-density="6"] .save,
  [data-density="10"] .caption-title, [data-density="10"] .save { display: none; }
  [data-density="6"] .caption, [data-density="10"] .caption { justify-content: center; height: 19px; padding: 0; }
  [data-density="10"] .no { font-size: clamp(7px, 2.1vw, 10px); }
  [data-density="6"] .gallery-grid, [data-density="10"] .gallery-grid { --gap: 3px; }
  dialog { padding: 10px 12px 12px; }
  .viewer-art { height: min(51vh, 338px); }
  .viewer-save { font-size: 11px; padding-inline: 8px; }
}
.thumb img { padding: 4% 7%; mix-blend-mode: multiply; }
.viewer-art img { padding: 3%; mix-blend-mode: multiply; }
