:root {
  color-scheme: dark;
  --black: #0c0d0c;
  --ground: #111211;
  --matte: #1d1e1c;
  --line: #42433e;
  --text: #f1efe8;
  --muted: #b3b4aa;
  --lime: #d8fc4a;
  --mono: Consolas, "SFMono-Regular", "Courier New", monospace;
  --edge: clamp(18px, 3.8vw, 78px);
  --gap: clamp(10px, 1.65vw, 30px);
  background: var(--ground);
  color: var(--text);
  font: 16px/1.45 "Segoe UI", -apple-system, BlinkMacSystemFont, Arial, sans-serif;
}
* { box-sizing: border-box; }
html { scrollbar-gutter: stable; }
body, h1, h2, p, figure { margin: 0; }
button, select, a { font: inherit; color: inherit; }
a { text-decoration: none; }
button, select { cursor: pointer; }
:focus-visible { outline: 2px solid var(--lime); outline-offset: 4px; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); overflow: hidden; white-space: nowrap; }
.skip-link { position: fixed; top: 8px; left: 10px; z-index: 3; padding: 10px 16px; background: var(--lime); color: var(--black); transform: translateY(-150%); }
.skip-link:focus { transform: translateY(0); }
.masthead { height: 68px; padding: 0 var(--edge); display: flex; align-items: center; justify-content: space-between; background: var(--black); border-bottom: 1px solid var(--line); }
.wordmark { font-size: 17px; font-weight: 680; letter-spacing: .22em; }
.home-link, .image-link { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; font: 13px var(--mono); }
.home-link:hover, .image-link:hover { color: var(--lime); }
.home-link span, .image-link span { font: 18px "Segoe UI", sans-serif; }
main { max-width: 2000px; margin-inline: auto; padding: clamp(30px, 3.5vw, 64px) var(--edge) clamp(52px, 7vw, 100px); }
.introduction { display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; padding-bottom: clamp(20px, 2.3vw, 40px); }
h1, h2 { font-weight: 350; letter-spacing: -.055em; line-height: .99; }
h1 { font-size: clamp(52px, 6.6vw, 108px); }
.introduction p { max-width: 32ch; padding-bottom: 4px; color: var(--muted); font-size: clamp(14px, 1.2vw, 18px); line-height: 1.45; }
.tools { min-height: 70px; margin-bottom: clamp(14px, 1.7vw, 27px); border-block: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 18px; }
.tools nav { display: inline-flex; align-self: stretch; gap: clamp(18px, 2vw, 36px); }
.tools nav a { display: grid; align-items: center; position: relative; min-height: 44px; color: var(--muted); font: clamp(13px, 1vw, 16px) var(--mono); }
.tools nav a[aria-current="page"] { color: var(--lime); }
.tools nav a[aria-current="page"]::after { position: absolute; bottom: -1px; width: 100%; height: 2px; background: var(--lime); content: ""; }
.filters { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.filters label { min-width: 0; }
select { max-width: min(20vw, 215px); min-height: 39px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 0; background: var(--ground); font: 13px var(--mono); }
select:hover { border-color: var(--muted); }
.result-count { margin-left: 10px; font: 12px var(--mono); color: var(--muted); white-space: nowrap; }
#works:focus { outline: none; }
#grid { display: flex; flex-direction: column; gap: clamp(28px, 2.4vw, 46px); }
.art-row { width: 100%; display: flex; align-items: flex-start; gap: var(--gap); }
.tile { display: block; flex-basis: 0; min-width: 0; }
.tile img { display: block; width: 100%; height: auto; background: var(--matte); }
.tile h2 { margin: 9px 0 2px; color: var(--text); font-size: clamp(15px, 1.3vw, 23px); font-weight: 430; letter-spacing: -.025em; line-height: 1.21; overflow-wrap: anywhere; }
.tile p { color: var(--muted); font: 12px/1.35 var(--mono); overflow-wrap: anywhere; }
.tile:hover h2, .tile:focus-visible h2 { color: var(--lime); }
.empty { padding: 34px 0; }
.empty p { color: var(--muted); }
.empty button { margin-top: 18px; border: 1px solid var(--line); background: transparent; padding: 10px 16px; font: 13px var(--mono); }
dialog { width: min(1400px, 96vw); height: min(900px, 93vh); height: min(900px, 93dvh); max-width: none; max-height: none; padding: 0; color: var(--text); border: 1px solid var(--line); background: var(--ground); }
dialog::backdrop { background: rgb(0 0 0 / .88); }
body:has(dialog[open]) { overflow: hidden; }
.viewer-layout { display: flex; flex-direction: column; height: 100%; }
.viewer-bar { display: flex; align-items: center; gap: 3px; padding: 6px 12px 6px 20px; border-bottom: 1px solid var(--line); background: var(--black); }
.viewer-heading { flex: 1; min-width: 0; display: flex; justify-content: space-between; align-items: center; }
.viewer-name { font-size: 18px; letter-spacing: -.035em; }
.position { margin-right: 8px; color: var(--muted); font: 12px var(--mono); white-space: nowrap; }
.viewer-bar button { min-height: 42px; min-width: 42px; border: 1px solid var(--line); background: transparent; font: 16px var(--mono); }
.viewer-bar #close { margin-left: 5px; padding: 0 11px; font-size: 13px; }
.viewer-bar #close span { margin-left: 5px; }
.viewer-bar button:hover:not(:disabled) { border-color: var(--lime); }
.viewer-bar button:disabled { cursor: default; opacity: .4; }
.viewer-bar #compare-toggle { display: inline-flex; align-items: center; gap: 7px; margin-right: 8px; padding: 0 12px; font: 13px var(--mono); }
#compare-toggle[aria-pressed="true"] { border-color: var(--lime); color: var(--lime); }
.split-symbol { display: inline-block; width: 12px; height: 12px; border: 1px solid currentColor; border-radius: 50%; background: linear-gradient(to right, currentColor 50%, transparent 50%); }
.viewer-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(245px, 27%); flex: 1; min-height: 0; }
.artwork { position: relative; display: grid; place-items: center; container-type: size; min-height: 0; min-width: 0; padding: clamp(23px, 1.8vw, 28px) clamp(10px, 1.8vw, 28px); background: var(--matte); }
#compare-frame { position: relative; width: min(100cqw, calc(100cqh * var(--art-ratio, 1))); aspect-ratio: var(--art-ratio, 1); }
#compare-frame img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
#plate { object-fit: contain; }
#original-plate { object-fit: fill; clip-path: inset(0 calc(100% - var(--reveal, 50%)) 0 0); }
#compare-caption { position: absolute; bottom: calc(100% + 3px); inset-inline: 0; display: flex; justify-content: space-between; color: var(--text); font: 11px/16px var(--mono); }
#compare-wipe { position: absolute; inset: 0; overflow: hidden; cursor: ew-resize; touch-action: none; user-select: none; }
#compare-wipe:has(:focus-visible) { outline: 2px solid var(--lime); outline-offset: 3px; }
#compare-divider { position: absolute; inset-block: 0; left: var(--reveal, 50%); width: 2px; transform: translateX(-50%); background: var(--text); box-shadow: 0 0 3px #000; pointer-events: none; }
#compare-divider span { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); display: grid; place-items: center; width: 36px; height: 36px; border: 1px solid var(--text); border-radius: 50%; color: var(--text); background: #111211; font: 18px/1 var(--mono); white-space: pre; }
#compare-range { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; touch-action: none; }
.compare-message { position: absolute; bottom: 8px; left: 50%; transform: translateX(-50%); width: max-content; max-width: 95%; padding: 5px 9px; background: var(--black); color: var(--text); text-align: center; font: 12px/1.4 var(--mono); }
#compare-retry { min-height: 36px; margin-left: 8px; padding: 0 8px; border: 1px solid var(--line); background: transparent; color: var(--lime); }
.details { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; gap: 24px; overflow: auto; padding: clamp(18px, 2.1vw, 34px); border-left: 1px solid var(--line); }
.effect-name { margin-bottom: 12px; font: 13px/1.4 var(--mono); color: var(--lime); }
h2 { font-size: clamp(27px, 3vw, 50px); line-height: 1.05; overflow-wrap: anywhere; }
.category-name { margin-top: 12px; color: var(--muted); font-size: 14px; }
#art-source { margin-top: 5px; font: 12px/1.5 var(--mono); color: var(--muted); overflow-wrap: anywhere; }
#art-note { margin-top: 22px; color: var(--text); font-size: 15px; line-height: 1.55; white-space: pre-line; }
@media (min-width: 721px) and (max-width: 1100px) {
  .tools { flex-wrap: wrap; gap: 0 14px; }
  .tools nav a { min-height: 48px; }
  .filters { flex-wrap: wrap; justify-content: flex-start; padding-block: 8px; }
}
@media (max-width: 720px) {
  .masthead { height: 54px; }
  .introduction { align-items: flex-start; flex-direction: column; gap: 13px; }
  .introduction p { max-width: 45ch; padding-bottom: 0; }
  .tools { flex-direction: column; align-items: stretch; gap: 0; border-bottom: none; }
  .tools nav { border-bottom: 1px solid var(--line); gap: 22px; }
  .filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; margin-top: 12px; }
  .filters select { width: 100%; max-width: none; min-height: 42px; font-size: 12px; padding-left: 5px; }
  .result-count { margin-left: 2px; font-size: 11px; }
  .viewer-body { display: flex; flex-direction: column; }
  .artwork { flex: 1; }
  .details { flex: none; display: block; max-height: 33%; border-left: none; border-top: 1px solid var(--line); padding: 14px 18px max(12px,env(safe-area-inset-bottom)); }
  .effect-name { margin-bottom: 4px; }
  .category-name, #art-note { margin-top: 7px; }
  .image-link { margin-top: 4px; min-height: 35px; }
  dialog { width: 100%; height: 100vh; height: 100dvh; border: 0; }
  .viewer-bar { padding-top: max(6px,env(safe-area-inset-top)); }
}
@media (max-width: 560px) {
  .viewer-heading { align-items: flex-start; flex-direction: column; }
  .viewer-bar { padding-inline: 10px; }
  .viewer-bar #compare-toggle { margin-right: 3px; padding-inline: 8px; }
  .viewer-name { line-height: 1.2; }
}
@media (max-width: 390px) {
  :root { --edge: 14px; }
  .tools { margin-bottom: 12px; }
  .filters select, .result-count { font-size: 11px; }
  .viewer-bar #close { margin-left: 1px; padding-inline: 8px; }
}
@media (max-width: 355px) {
  .viewer-bar { padding-inline: 8px; }
  .viewer-bar #compare-toggle { margin-right: 0; padding-inline: 7px; }
  .viewer-bar .split-symbol, .viewer-bar #close span { display: none; }
  .viewer-name { font-size: 16px; white-space: nowrap; }
}
