/* InspiredBy: a quiet gallery. The art is the hero; palette chips are the signature. */
:root {
  --bg: #fbfaf7; --bg2: #f3f0ea; --card: #ffffff; --ink: #1d1b18; --ink2: #4a463f; --muted: #6f695f;
  --line: #e4dfd5; --accent: #9b3b22; --accent2: #2f5d9e; --wall: #eeeae2; --shadow: 0 1px 2px rgba(30,25,15,.06), 0 6px 24px rgba(30,25,15,.07);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", "URW Palladio L", Georgia, Cambria, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --r: 6px; --gut: 16px; --max: 1240px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d0d0e; --bg2: #161617; --card: #1a1a1b; --ink: #ece8e1; --ink2: #cbc5bb; --muted: #9a948a;
    --line: #2c2b29; --accent: #e3926c; --accent2: #8fb0e3; --wall: #121213; --shadow: 0 1px 2px rgba(0,0,0,.5), 0 8px 28px rgba(0,0,0,.45);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0d0d0e; --bg2: #161617; --card: #1a1a1b; --ink: #ece8e1; --ink2: #cbc5bb; --muted: #9a948a;
  --line: #2c2b29; --accent: #e3926c; --accent2: #8fb0e3; --wall: #121213; --shadow: 0 1px 2px rgba(0,0,0,.5), 0 8px 28px rgba(0,0,0,.45);
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.6 var(--sans); }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
h1, h2, h3, .serif { font-family: var(--serif); font-weight: 500; letter-spacing: -.005em; line-height: 1.15; }
h1 { font-size: clamp(2rem, 4.2vw, 3.1rem); margin: .2em 0 .35em; }
h2 { font-size: clamp(1.45rem, 2.6vw, 1.95rem); margin: 2.2em 0 .6em; }
h3 { font-size: 1.2rem; margin: 1.4em 0 .4em; }
p { margin: 0 0 1em; }
code { font-family: var(--mono); font-size: .88em; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gut); }
.narrow { max-width: 760px; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.lede { font-size: 1.15rem; color: var(--ink2); max-width: 46em; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 8px; top: 8px; background: var(--card); padding: 6px 10px; z-index: 10; }
:focus-visible { outline: 2px solid var(--accent2); outline-offset: 2px; }
.no-js .js-only { display: none !important; }

/* header */
.top { border-bottom: 1px solid var(--line); background: var(--bg); position: sticky; top: 0; z-index: 5; }
.top .bar { display: flex; align-items: center; gap: 18px; min-height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-family: var(--serif); font-size: 1.35rem; white-space: nowrap; }
.brand img { width: 28px; height: 28px; }
.brand em { font-style: italic; color: var(--accent); }
.top nav { display: flex; gap: 18px; margin-left: auto; overflow-x: auto; scrollbar-width: none; }
.top nav::-webkit-scrollbar { display: none; }
.top nav a { color: var(--ink2); text-decoration: none; font-size: .95rem; white-space: nowrap; padding: 4px 0; }
.top nav a:hover, .top nav a[aria-current] { color: var(--ink); box-shadow: inset 0 -2px 0 var(--accent); }
.iconbtn { background: none; border: 1px solid var(--line); color: var(--ink2); border-radius: 999px; height: 34px; min-width: 34px; padding: 0 10px; cursor: pointer; font: inherit; font-size: .9rem; display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
.iconbtn:hover { color: var(--ink); border-color: var(--ink2); }
@media (max-width: 760px) {
  .top .bar { flex-wrap: wrap; gap: 6px 12px; padding-top: 8px; }
  .top nav { order: 3; width: 100%; margin: 0; padding-bottom: 8px; gap: 16px; }
  .top .tools { margin-left: auto; }
}
.tools { display: flex; gap: 8px; }

/* breadcrumbs */
.crumbs { font-size: .85rem; color: var(--muted); margin: 18px 0 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 4px; }
.crumbs li + li::before { content: "/"; margin-right: 4px; color: var(--line); }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--ink); }

/* palette strip: the signature element */
.strip { display: flex; height: 8px; border-radius: 2px; overflow: hidden; }
.strip span { display: block; height: 100%; }
.strip.tall { height: 14px; }

/* cards & grids */
/* fixed column counts, short last row centred (PARK-56): .grid 4/3/2, .grid.dense 6/3/2 */
.grid { --cols: 4; display: flex; flex-wrap: wrap; justify-content: center; gap: 28px 22px; }
.grid.dense { --cols: 6; gap: 22px 16px; }
.grid > * { flex: 0 1 calc((100% - (var(--cols) - 1) * 22px) / var(--cols)); min-width: 0; }
.grid.dense > * { flex-basis: calc((100% - (var(--cols) - 1) * 16px) / var(--cols)); }
@media (max-width: 1000px) { .grid, .grid.dense { --cols: 3; } }
@media (max-width: 520px) { .grid, .grid.dense { --cols: 2; gap: 20px 12px; } .grid > *, .grid.dense > * { flex-basis: calc((100% - 12px) / 2); } }
.card { display: flex; flex-direction: column; gap: 8px; color: var(--ink); text-decoration: none; min-width: 0; position: relative; }
.card .frame { background: var(--wall); display: flex; align-items: center; justify-content: center; aspect-ratio: 4 / 5; padding: 14px; border-radius: 2px; transition: background .2s; }
.card .frame img { max-height: 100%; width: auto; max-width: 100%; object-fit: contain; box-shadow: var(--shadow); }
.card:hover .frame { background: var(--bg2); }
.card .t { font-family: var(--serif); font-size: 1.02rem; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card .a { font-size: .84rem; color: var(--muted); line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card:hover .t { color: var(--accent); }

/* tiles for themes/collections */
.tiles { display: flex; flex-wrap: wrap; justify-content: center; gap: 18px; }
.tiles > * { flex: 0 1 calc((100% - 3 * 18px) / 4); min-width: 0; }   /* 4 / 2 columns, short last row centred (PARK-56) */
@media (max-width: 700px) { .tiles > * { flex-basis: calc((100% - 18px) / 2); } }
@media (max-width: 520px) { .tiles { gap: 12px; } .tiles > * { flex-basis: calc((100% - 12px) / 2); } }
.tile { position: relative; display: block; border-radius: var(--r); overflow: hidden; color: #fff; text-decoration: none; aspect-ratio: 4 / 3; background: #222; }
.tile img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; opacity: .92; }
.tile:hover img { transform: scale(1.04); }
.tile .lbl { position: absolute; inset: auto 0 0 0; padding: 30px 14px 12px; background: linear-gradient(transparent, rgba(0,0,0,.78)); }
.tile .lbl b { display: block; font-family: var(--serif); font-weight: 500; font-size: 1.2rem; line-height: 1.2; }
.tile .lbl small { opacity: .85; font-size: .8rem; }
.tile .strip { position: absolute; left: 0; right: 0; top: 0; height: 6px; border-radius: 0; }

/* hero */
.hero { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 48px; align-items: center; padding: 34px 0 10px; }
.hero .art { background: var(--wall); padding: clamp(16px, 3vw, 40px); display: flex; justify-content: center; border-radius: 2px; }
.hero .art img { box-shadow: var(--shadow); max-height: 70vh; width: auto; }
.hero .kicker { text-transform: uppercase; letter-spacing: .14em; font-size: .75rem; color: var(--muted); margin: 0; }
.hero h1 { margin-top: .15em; }
@media (max-width: 860px) { .hero { grid-template-columns: 1fr; gap: 18px; padding-top: 18px; } .hero .art img { max-height: 60vh; } }

/* family swatches */
.fams { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }   /* 13 families since PARK-73: 7 / 5 / 2 per row, short last row centred (PARK-56) */
.fams > * { flex: 0 1 calc((100% - 6 * 12px) / 7); min-width: 0; }
@media (max-width: 1000px) { .fams > * { flex-basis: calc((100% - 4 * 12px) / 5); } }
@media (max-width: 520px) { .fams > * { flex-basis: calc((100% - 12px) / 2); } }
.fam { display: flex; align-items: center; gap: 10px; padding: 8px; border: 1px solid var(--line); border-radius: var(--r); text-decoration: none; color: var(--ink); background: var(--card); }
.fam i { width: 34px; height: 34px; border-radius: 4px; flex: none; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); }
.fam small { display: block; color: var(--muted); font-size: .78rem; }
.fam:hover { border-color: var(--ink2); }

/* artwork page */
.work { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(300px, 1fr); gap: 44px; margin-top: 18px; }
@media (min-width: 901px) { .work > div:first-child { position: sticky; top: 76px; align-self: start; } }
@media (max-width: 900px) { .work { grid-template-columns: 1fr; gap: 20px; } }
.stage { background: var(--wall); padding: clamp(14px, 3vw, 44px); display: flex; align-items: center; justify-content: center; border-radius: 2px; position: relative; min-height: 200px; }
.stage img { box-shadow: var(--shadow); max-height: 78vh; width: auto; cursor: zoom-in; }
.stage .zoom { position: absolute; right: 10px; bottom: 10px; background: var(--card); }
.work h1 { font-size: clamp(1.7rem, 3vw, 2.4rem); margin-top: 0; }
.work .by { font-size: 1.1rem; margin: -.2em 0 1em; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0 0 1.2em; font-size: .93rem; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 6px; }
.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--card); color: var(--ink); padding: 7px 13px; border-radius: 999px; font: inherit; font-size: .9rem; cursor: pointer; text-decoration: none; }
.btn:hover { border-color: var(--ink2); }
.btn.primary { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.credit { font-size: .84rem; color: var(--muted); border-top: 1px solid var(--line); padding-top: 12px; margin-top: 18px; }

/* palette panel */
.palette { display: flex; flex-direction: column; gap: 6px; margin: 8px 0 10px; }
.chip { display: grid; grid-template-columns: 1fr auto; align-items: center; min-height: 46px; padding: 6px 12px; border-radius: 4px; font-size: .86rem; box-shadow: inset 0 0 0 1px rgba(0,0,0,.06); }
.chip b { font-family: var(--serif); font-weight: 500; font-size: 1.02rem; }
.chip code { font-size: .82rem; }
.chip .meta { text-align: right; line-height: 1.25; }
.chip button { all: unset; cursor: pointer; }
.chip button:focus-visible { outline: 2px solid currentColor; }
.chips-row { display: flex; gap: 4px; }
.chips-row span { flex: 1; height: 26px; border-radius: 3px; }
.export { margin-top: 6px; }
.export textarea { width: 100%; min-height: 120px; font: .8rem/1.4 var(--mono); background: var(--bg2); color: var(--ink); border: 1px solid var(--line); border-radius: 4px; padding: 8px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 8px 16px; border-radius: 999px; font-size: .9rem; z-index: 50; }

/* section headings with links */
.sh { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.sh h2 { margin-bottom: .5em; }
.sh a { font-size: .92rem; }

/* filters */
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 10px 0 22px; padding: 12px; background: var(--bg2); border-radius: var(--r); }
.filters label { font-size: .85rem; color: var(--muted); display: flex; flex-direction: column; gap: 2px; }
.filters select, .filters input[type=search] { font: inherit; font-size: .92rem; padding: 6px 8px; border: 1px solid var(--line); border-radius: 4px; background: var(--card); color: var(--ink); min-width: 0; max-width: 100%; }
.filters input[type=search] { width: 220px; }
@media (max-width: 520px) { .filters label { flex: 1 1 45%; } .filters input[type=search] { width: 100%; } }
.count { font-size: .9rem; color: var(--muted); margin: -8px 0 16px; }

/* colour picker tool */
.picker { display: grid; grid-template-columns: auto 1fr; gap: 18px; align-items: center; padding: 16px; background: var(--bg2); border-radius: var(--r); margin: 12px 0 24px; }
.picker input[type=color] { width: 84px; height: 84px; border: none; padding: 0; background: none; cursor: pointer; }
.picker .presets { display: flex; flex-wrap: wrap; gap: 6px; }
.picker .presets button { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--card); box-shadow: 0 0 0 1px var(--line); cursor: pointer; }
.match { font-size: .78rem; color: var(--muted); }

/* search (PARK-73) */
.hsearch { display: flex; align-items: center; gap: 4px; }
.hsearch input { font: inherit; font-size: .88rem; height: 34px; width: 170px; padding: 0 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); color: var(--ink); }
@media (max-width: 1100px) { .hsearch input { width: 130px; } }
@media (max-width: 760px) { .hsearch input { display: none; } }
.sform { display: flex; gap: 8px; margin: 14px 0 10px; }
.sform input { flex: 1; min-width: 0; font: inherit; font-size: 1.08rem; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--card); color: var(--ink); }
.sform input:focus { border-color: var(--accent2); }
.btn.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.sbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; margin: 4px 0 8px; }
.spicker { display: inline-flex; align-items: center; gap: 8px; }
.spicker input[type=color] { width: 40px; height: 36px; border: 1px solid var(--line); border-radius: 4px; padding: 2px; background: var(--card); cursor: pointer; }
.sbar .presets { display: flex; flex-wrap: wrap; gap: 6px; }
.sbar .presets button { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--card); box-shadow: 0 0 0 1px var(--line); cursor: pointer; }
kbd { font-family: var(--mono); font-size: .82em; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 3px; padding: 0 4px; background: var(--card); }
.qchips { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 14px; }
.qchip { display: inline-flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: .85rem; padding: 3px 4px 3px 4px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); }
.qchip.text { font-family: var(--sans); padding: 3px 10px; }
.qchip i { width: 22px; height: 22px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0,0,0,.15); }
.qchip button { border: 0; background: none; color: var(--muted); font-size: 1.1rem; line-height: 1; cursor: pointer; padding: 0 6px; border-radius: 999px; }
.qchip button:hover { color: var(--ink); }
.scard .strip { height: 12px; gap: 2px; overflow: visible; }
.scard .strip span { border-radius: 2px; }
.scard .strip span.hit { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--ink); position: relative; z-index: 1; }
.scard .match { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; color: var(--ink2); }
.scard .match b { font-weight: 600; }
.pairs { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.pair { display: inline-flex; align-items: center; gap: 2px; }
.pair i { width: 14px; height: 14px; border-radius: 3px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.2); }
.pair b { font-size: .7rem; color: var(--muted); font-weight: 400; }

/* charts */
.chart-wrap { overflow-x: auto; margin: 6px 0 18px; }
.chart-wrap svg { min-width: 640px; width: 100%; height: auto; display: block; }
.chart-wrap .ax { font: 11px var(--sans); fill: var(--muted); }
.chart-wrap .gl { stroke: var(--line); stroke-width: 1; }
.chart-wrap .ln { fill: none; stroke: var(--ink2); stroke-width: 2; }

/* timeline */
.timeline { list-style: none; padding: 0; margin: 0; border-left: 2px solid var(--line); }
.timeline li { position: relative; padding: 0 0 18px 20px; }
.timeline li::before { content: ""; position: absolute; left: -6px; top: 8px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.timeline .yr { font-family: var(--serif); font-size: 1.1rem; }

/* on this day */
.days { columns: 3 280px; column-gap: 32px; }
.day { break-inside: avoid; margin-bottom: 14px; }
.day h3 { font-size: 1rem; margin: 0 0 2px; }
.day ul { margin: 0; padding-left: 18px; font-size: .9rem; }
.day.today { background: var(--bg2); padding: 8px 10px; border-radius: var(--r); }
.otd { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.otd > * { flex: 0 1 calc((100% - 2 * 12px) / 3); min-width: 0; }   /* up to 6: 3 / 2 / 1 columns, short last row centred (PARK-56) */
@media (max-width: 900px) { .otd > * { flex-basis: calc((100% - 12px) / 2); } }
@media (max-width: 560px) { .otd > * { flex-basis: 100%; } }
.otd a.p { display: flex; gap: 12px; align-items: center; padding: 10px; border: 1px solid var(--line); border-radius: var(--r); text-decoration: none; color: var(--ink); background: var(--card); }
.otd img { width: 60px; height: 60px; object-fit: cover; border-radius: 3px; flex: none; }
.otd small { display: block; color: var(--muted); }

/* lists */
.cols { columns: 3 220px; column-gap: 28px; padding: 0; list-style: none; }
.cols li { break-inside: avoid; padding: 3px 0; }
.cols small { color: var(--muted); }
.pills { display: flex; flex-wrap: wrap; gap: 6px; padding: 0; list-style: none; margin: 0 0 1em; }
.pills a { display: inline-block; padding: 4px 11px; border: 1px solid var(--line); border-radius: 999px; font-size: .86rem; color: var(--ink2); text-decoration: none; background: var(--card); }
.pills a:hover { border-color: var(--ink2); color: var(--ink); }
table.data { border-collapse: collapse; width: 100%; font-size: .9rem; }
table.data th, table.data td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.data th { color: var(--muted); font-weight: 500; }
.scroll { overflow-x: auto; }

/* stats row */
.stats { display: flex; flex-wrap: wrap; gap: 28px; margin: 6px 0 18px; }
.stats div { min-width: 110px; }
.stats b { display: block; font-family: var(--serif); font-size: 1.7rem; font-weight: 500; }
.stats span { color: var(--muted); font-size: .85rem; }

/* fingerprint */
.fp { display: flex; align-items: flex-end; gap: 2px; height: 120px; overflow-x: auto; padding-bottom: 4px; }
.fp a { display: flex; flex-direction: column-reverse; flex: 1 1 0; min-width: 8px; max-width: 34px; height: 100%; text-decoration: none; }
.fp a span { display: block; width: 100%; }
.fpaxis { display: flex; justify-content: space-between; font-size: .8rem; color: var(--muted); }

/* viewer */
.viewer { position: fixed; inset: 0; background: rgba(8,8,8,.96); z-index: 100; touch-action: none; overflow: hidden; }
.viewer img { position: absolute; left: 0; top: 0; transform-origin: 0 0; max-width: none; user-select: none; -webkit-user-drag: none; cursor: grab; }
.viewer .vbar { position: absolute; top: 10px; right: 10px; display: flex; gap: 6px; z-index: 2; }
.viewer .vbar button { background: rgba(255,255,255,.12); color: #fff; border: 1px solid rgba(255,255,255,.25); border-radius: 999px; min-width: 40px; height: 40px; font-size: 1.1rem; cursor: pointer; }
.viewer .hint { position: absolute; left: 0; right: 0; bottom: 12px; text-align: center; color: rgba(255,255,255,.7); font-size: .85rem; }

/* footer */
.foot { margin-top: 70px; border-top: 1px solid var(--line); background: var(--bg2); padding: 28px 0 40px; font-size: .86rem; color: var(--muted); }
.foot a { color: var(--ink2); }
.foot .fstrip { display: flex; height: 4px; margin-bottom: 22px; }
.foot .fstrip span { flex: 1; }

.note { background: var(--bg2); border-left: 3px solid var(--accent); padding: 10px 14px; border-radius: 0 var(--r) var(--r) 0; font-size: .93rem; }
.pager { display: flex; justify-content: space-between; gap: 12px; margin: 30px 0; font-size: .95rem; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }
@media print { .top, .foot, .actions, .btn, .stage .zoom { display: none !important; } }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (max-width: 520px) { .chart-wrap svg { min-width: 760px; } }
.sw { display: inline-block; width: 12px; height: 12px; border-radius: 2px; vertical-align: -1px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.15); }
details { margin: 12px 0; } details summary { cursor: pointer; color: var(--accent); }
#sextra { margin: 6px 0 18px; } #sextra p { margin: 0; }
