/* Layout: a quiet catalog header over an even grid of works; a dark viewer opens one work at a time. */
:root {
  --paper: #ffffff;
  --ink: #141416;
  --muted: #6d6d75;
  --rule: #e5e5ea;
  --tile: #f3f3f6;
  --accent: #6e1eff;
  --danger: #b4232c;
  --ok: #1f7a4a;
  --stage: #0d0d0f;
  --stage-ink: #f1f1f4;
  --stage-muted: #9b9ba4;
  --stage-rule: #3a3a42;
  --font-display: "Libre Baskerville", Baskerville, "Baskerville Old Face", Georgia, serif;
  --font-body: "Hanken Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  color-scheme: light;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #111113; --ink: #f0f0f3; --muted: #9a9aa3; --rule: #26262c; --tile: #1b1b1f;
    --accent: #a88bff; --danger: #ff7a80; --ok: #5fd39a;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #111113; --ink: #f0f0f3; --muted: #9a9aa3; --rule: #26262c; --tile: #1b1b1f;
  --accent: #a88bff; --danger: #ff7a80; --ok: #5fd39a;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
img { max-width: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
}
.page {
  max-width: 1360px;
  margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: 40px 64px;
}
header.intro {
  display: grid;
  gap: 10px;
  padding-bottom: 28px;
  margin-bottom: 32px;
  border-bottom: 1px solid var(--rule);
}
.kicker {
  font-family: var(--font-display);
  font-size: 0.85rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0;
}
h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.6rem, 7vw, 4.6rem);
  line-height: 1.05;
  letter-spacing: -0.01em;
  margin: 0;
  text-wrap: balance;
}
.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  color: var(--muted);
  margin: 6px 0 0;
}
.meta span { font-variant-numeric: tabular-nums; }
.status { color: var(--muted); margin: 0 0 24px; }

.grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr));
  gap: 28px 16px;
  align-items: start;
}
@media (min-width: 640px) { .grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 40px 24px; } }
.work {
  all: unset;
  box-sizing: border-box;
  display: grid;
  gap: 10px;
  width: 100%;
  cursor: zoom-in;
}
.work img {
  display: block;
  width: 100%;
  height: auto;
  background: var(--tile);
  transition: opacity 0.2s ease;
}
.work:hover img { opacity: 0.88; }
.work:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.caption { display: grid; gap: 2px; min-width: 0; }
.caption-title {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 0.95rem;
  overflow-wrap: anywhere;
}
.caption-price { color: var(--muted); font-size: 0.9rem; font-variant-numeric: tabular-nums; }
footer {
  margin-top: 56px;
  padding-top: 20px;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.85rem;
}

.viewer {
  position: fixed;
  inset: 0;
  z-index: 10;
  background: var(--stage);
  color: var(--stage-ink);
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding-top: calc(12px + env(safe-area-inset-top, 0px));
  padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  color-scheme: dark;
}
.viewer-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; }
.viewer-bar > div { min-width: 0; }
.viewer-title { font-family: var(--font-display); font-style: italic; font-size: 1.05rem; overflow-wrap: anywhere; }
.viewer-sub { color: var(--stage-muted); font-variant-numeric: tabular-nums; font-size: 0.9rem; }
.viewer-stage { position: relative; display: grid; place-items: center; min-height: 0; touch-action: pan-y; }
.viewer-stage img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
}
.viewer-nav { display: flex; justify-content: center; gap: 12px; padding-top: 10px; }
.vbtn {
  font: inherit;
  color: var(--stage-ink);
  background: transparent;
  border: 1px solid var(--stage-rule);
  border-radius: 999px;
  min-width: 44px;
  height: 44px;
  padding: 0 18px;
  cursor: pointer;
}
.vbtn:hover { border-color: var(--stage-muted); }
.vbtn:focus-visible { outline: 2px solid #a88bff; outline-offset: 2px; }
.vbtn:disabled { opacity: 0.35; cursor: default; }
@media (prefers-reduced-motion: reduce) { .work img { transition: none; } }
