:root {
  --paper: #f7f4ed;
  --paper-soft: #fffaf0;
  --ink: #20201d;
  --muted: #726b61;
  --line: #ded4c4;
  --gold: #c8a15a;
  --red: #8c2f2f;
  --shadow: 0 18px 48px rgba(42, 33, 22, 0.11);
  --container: min(960px, calc(100vw - 28px));
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    linear-gradient(rgba(32, 32, 29, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(32, 32, 29, 0.022) 1px, transparent 1px),
    var(--paper);
  background-size: 24px 24px;
  color: var(--ink);
  font-family: ui-serif, Georgia, "Times New Roman", "Songti SC", "STSong", serif;
  line-height: 1.58;
}

body.viewer-open {
  overflow: hidden;
}

button {
  font: inherit;
  cursor: pointer;
}

img {
  display: block;
  max-width: 100%;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: center;
  min-height: 62px;
  border-bottom: 1px solid rgba(222, 212, 196, 0.86);
  background: rgba(247, 244, 237, 0.9);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: var(--container);
  color: var(--ink);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0;
  text-decoration: none;
}

.brand img {
  width: 34px;
  height: 34px;
}

.intro {
  width: var(--container);
  margin: 0 auto;
  padding: 30px 0 18px;
}

.kicker {
  margin: 0 0 6px;
  color: var(--red);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 8px;
  font-size: clamp(34px, 11vw, 62px);
  line-height: 1.02;
  letter-spacing: 0;
}

.intro-text {
  max-width: 560px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 16px;
}

.gallery-shell {
  width: var(--container);
  margin: 0 auto;
  padding: 12px 0 46px;
}

.gallery-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

h2 {
  margin-bottom: 0;
  font-size: 22px;
  line-height: 1.2;
  letter-spacing: 0;
}

.gallery-head span {
  color: var(--muted);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.gallery {
  display: grid;
  gap: 18px;
}

.gallery-group {
  display: grid;
  gap: 12px;
}

.group-title {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 10px 0 0;
  color: var(--red);
  font-size: 17px;
}

.group-title::before {
  content: "";
  width: 10px;
  height: 10px;
  border: 2px solid var(--gold);
  transform: rotate(45deg);
}

.artwork-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper-soft);
  box-shadow: var(--shadow);
}

.artwork-button {
  display: grid;
  width: 100%;
  border: 0;
  background: transparent;
  padding: 0;
  color: inherit;
  text-align: left;
}

.artwork-image {
  display: grid;
  min-height: 220px;
  place-items: center;
  background: #eee5d8;
}

.artwork-image img {
  width: 100%;
  height: auto;
}

.artwork-caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 13px;
  border-top: 1px solid var(--line);
}

.artwork-caption strong {
  min-width: 0;
  font-size: 17px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.artwork-caption span {
  color: var(--muted);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 260px;
  border: 1px dashed #cbbda9;
  border-radius: var(--radius);
  background: rgba(255, 250, 240, 0.72);
  color: var(--muted);
  text-align: center;
}

.empty-state img {
  width: min(260px, 72vw);
  margin-bottom: 14px;
}

.empty-state p {
  margin-bottom: 0;
}

.viewer {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  background: rgba(15, 13, 10, 0.96);
  color: #fff;
}

.viewer[hidden] {
  display: none;
}

.viewer-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 62px;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.viewer-top strong,
.viewer-top span {
  display: block;
}

.viewer-top strong {
  font-size: 16px;
  line-height: 1.25;
}

.viewer-top span {
  color: rgba(255, 255, 255, 0.62);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 12px;
  font-weight: 700;
}

.viewer-close,
.viewer-nav {
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.viewer-close {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  font-size: 26px;
  line-height: 1;
}

.viewer > img {
  align-self: center;
  justify-self: center;
  width: 100%;
  max-height: calc(100vh - 84px);
  object-fit: contain;
  padding: 12px;
}

.viewer-nav {
  position: fixed;
  top: 50%;
  width: 42px;
  height: 58px;
  border-radius: var(--radius);
  font-size: 40px;
  line-height: 1;
  transform: translateY(-50%);
}

.viewer-nav.prev {
  left: 10px;
}

.viewer-nav.next {
  right: 10px;
}

@media (min-width: 760px) {
  .site-header {
    min-height: 76px;
  }

  .brand {
    font-size: 22px;
  }

  .brand img {
    width: 42px;
    height: 42px;
  }

  .intro {
    padding-top: 48px;
  }

  .gallery {
    gap: 24px;
  }

  .artwork-caption {
    padding: 14px 16px;
  }

  .viewer > img {
    padding: 22px 74px;
  }
}

@media (max-width: 520px) {
  .viewer-nav {
    top: auto;
    bottom: 16px;
    width: 42px;
    height: 42px;
    font-size: 30px;
    transform: none;
  }
}
