:root {
  --paper: #f4f1ea;
  --paper-deep: #e7e1d5;
  --ink: #171511;
  --muted: #706a60;
  --line: rgba(23, 21, 17, 0.18);
  --veil: rgba(244, 241, 234, 0.9);
  --shadow: 0 22px 70px rgba(32, 27, 18, 0.14);
  --max: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    linear-gradient(90deg, rgba(23, 21, 17, 0.035) 1px, transparent 1px) 0 0 / 72px 72px,
    var(--paper);
  color: var(--ink);
  font-family: "Times New Roman", "Noto Serif SC", "Songti SC", serif;
  font-size: 16px;
  letter-spacing: 0;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.28em;
}

button {
  font: inherit;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: min(var(--max), calc(100% - 40px));
  margin: 0 auto;
  padding: 22px 0;
  background: linear-gradient(to bottom, var(--paper) 72%, rgba(244, 241, 234, 0));
}

.brand {
  font-size: 1.05rem;
  letter-spacing: 0.14em;
  text-decoration: none;
  text-transform: lowercase;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 22px;
  color: var(--muted);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
}

.site-nav a {
  text-decoration: none;
}

.hero {
  display: grid;
  grid-template-columns: minmax(240px, 0.82fr) minmax(320px, 1.18fr);
  gap: clamp(36px, 7vw, 96px);
  align-items: end;
  width: min(var(--max), calc(100% - 40px));
  min-height: calc(100svh - 76px);
  margin: 0 auto;
  padding: clamp(42px, 8vw, 96px) 0 72px;
}

.hero-copy {
  padding-bottom: clamp(8px, 4vw, 48px);
}

.date-mark,
.section-heading p,
.artwork-index,
.artwork-date,
.site-footer {
  color: var(--muted);
  font-family: Arial, "Noto Sans SC", sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hero h1 {
  max-width: 9.5em;
  margin: 24px 0 28px;
  font-size: clamp(2.7rem, 7.6vw, 7.1rem);
  font-weight: 400;
  line-height: 0.98;
}

.hero-copy p:last-child {
  max-width: 29em;
  margin: 0;
  color: var(--muted);
  font-size: clamp(1rem, 1.8vw, 1.22rem);
  line-height: 1.9;
}

.hero-frame {
  margin: 0;
}

.hero-frame img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  box-shadow: var(--shadow);
}

.hero-frame figcaption {
  margin-top: 14px;
  color: var(--muted);
  font-size: 0.82rem;
  text-align: right;
}

.intro {
  width: min(740px, calc(100% - 40px));
  margin: 30px auto 120px;
  padding: 58px 0 0;
  border-top: 1px solid var(--line);
}

.intro p {
  margin: 0;
  color: #39342c;
  font-size: clamp(1.2rem, 2.4vw, 2rem);
  font-weight: 400;
  line-height: 1.86;
}

.gallery-section {
  width: min(var(--max), calc(100% - 40px));
  margin: 0 auto;
  padding-bottom: 108px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 46px;
  border-top: 1px solid var(--line);
  padding-top: 24px;
}

.section-heading p,
.section-heading h2 {
  margin: 0;
}

.section-heading h2 {
  font-size: clamp(1.6rem, 3vw, 2.7rem);
  font-weight: 400;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: clamp(20px, 3vw, 42px);
  align-items: start;
}

.artwork {
  grid-column: span 6;
  margin: 0;
}

.artwork:nth-child(4n + 2),
.artwork:nth-child(4n + 3) {
  grid-column: span 5;
}

.artwork:nth-child(4n + 3) {
  margin-top: 8vw;
}

.artwork:nth-child(6n) {
  grid-column: 8 / span 5;
}

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

.artwork-image {
  width: 100%;
  background: var(--paper-deep);
  object-fit: cover;
  transition: transform 420ms ease, filter 420ms ease;
}

.artwork-button:hover .artwork-image,
.artwork-button:focus-visible .artwork-image {
  filter: saturate(0.86) contrast(1.04);
  transform: translateY(-3px);
}

.artwork-button:focus-visible {
  outline: 1px solid var(--ink);
  outline-offset: 8px;
}

.artwork-caption {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: baseline;
  margin-top: 14px;
}

.artwork-title {
  font-size: clamp(1.1rem, 2vw, 1.55rem);
  line-height: 1.35;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  width: min(var(--max), calc(100% - 40px));
  margin: 0 auto;
  padding: 34px 0 44px;
  border-top: 1px solid var(--line);
}

.site-footer p {
  margin: 0;
}

.footer-meta {
  display: grid;
  gap: 8px;
}

.copyright {
  color: #4e493f;
  letter-spacing: 0.04em;
  text-transform: none;
}

.site-footer span {
  color: var(--ink);
  text-transform: none;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  place-items: center;
  padding: 24px;
  background: rgba(17, 15, 12, 0.76);
}

.lightbox.is-open {
  display: grid;
}

.lightbox-panel {
  position: relative;
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr) 76px;
  align-items: center;
  width: min(1280px, 100%);
  max-height: calc(100svh - 48px);
  color: var(--paper);
}

.lightbox figure {
  margin: 0;
}

.lightbox img {
  width: 100%;
  max-height: calc(100svh - 140px);
  object-fit: contain;
  background: #0f0d0a;
}

.lightbox figcaption {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  margin-top: 16px;
  color: var(--paper);
}

.lightbox small {
  color: rgba(244, 241, 234, 0.68);
  font-family: Arial, "Noto Sans SC", sans-serif;
  letter-spacing: 0.08em;
}

.icon-button,
.nav-button {
  border: 1px solid rgba(244, 241, 234, 0.5);
  background: rgba(244, 241, 234, 0.08);
  color: var(--paper);
  cursor: pointer;
}

.icon-button:focus-visible,
.nav-button:focus-visible {
  outline: 2px solid var(--paper);
  outline-offset: 4px;
}

.close-button {
  position: absolute;
  top: -2px;
  right: 0;
  width: 44px;
  height: 44px;
}

.close-button span,
.close-button span::after {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 1px;
  background: currentColor;
  content: "";
}

.close-button span {
  transform: translate(-50%, -50%) rotate(45deg);
}

.close-button span::after {
  transform: translate(-50%, -50%) rotate(90deg);
}

.nav-button {
  justify-self: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  font-family: Arial, "Noto Sans SC", sans-serif;
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.noscript-note {
  color: var(--muted);
}

@media (max-width: 840px) {
  .site-header {
    width: min(100% - 28px, var(--max));
  }

  .hero {
    grid-template-columns: 1fr;
    width: min(100% - 28px, var(--max));
    min-height: auto;
    padding-top: 38px;
  }

  .hero-copy {
    padding-bottom: 0;
  }

  .hero h1 {
    max-width: 8.6em;
  }

  .intro,
  .gallery-section,
  .site-footer {
    width: min(100% - 28px, var(--max));
  }

  .intro {
    margin-bottom: 82px;
  }

  .gallery {
    grid-template-columns: 1fr;
  }

  .artwork,
  .artwork:nth-child(4n + 2),
  .artwork:nth-child(4n + 3),
  .artwork:nth-child(6n) {
    grid-column: auto;
    margin-top: 0;
  }

  .artwork-caption {
    grid-template-columns: auto 1fr;
  }

  .artwork-date {
    grid-column: 2;
  }

  .lightbox {
    padding: 14px;
  }

  .lightbox-panel {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  .lightbox figure {
    grid-column: 1 / -1;
    grid-row: 1;
  }

  .prev-button,
  .next-button {
    grid-row: 2;
  }

  .prev-button {
    justify-self: end;
  }

  .next-button {
    justify-self: start;
  }

  .lightbox img {
    max-height: calc(100svh - 180px);
  }

  .lightbox figcaption,
  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
