:root { color: #111; background: #fff; font-family: "Courier New", Courier, monospace; }
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; background: #fff; }
button, a { color: inherit; font: inherit; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 5;
  width: 25vw;
  min-width: 260px;
  padding: 34px 3vw;
  background: #fff;
}

.home-link { display: inline-block; margin-bottom: 12vh; font-size: .9rem; text-decoration: none; }
.sidebar nav { display: flex; flex-direction: column; align-items: flex-start; gap: clamp(34px, 6vh, 74px); }

.category-link {
  font-size: clamp(1.15rem, 1.65vw, 1.75rem);
  line-height: 1;
  text-decoration: none;
  opacity: .42;
  transition: opacity .2s ease, transform .2s ease;
}

.category-link:hover, .category-link:focus-visible, .category-link.active { opacity: 1; transform: translateX(5px); }
.art-scroll { margin-left: max(25vw, 260px); padding: 0 clamp(24px, 5vw, 90px); }

.category-section {
  min-height: 100vh;
  padding: clamp(76px, 10vh, 120px) 0 16vh;
  scroll-margin-top: 0;
}

.category-section h1, .category-section h2 {
  margin: 0 0 clamp(52px, 9vh, 100px);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(3.3rem, 8vw, 8rem);
  font-weight: 400;
  line-height: .85;
  letter-spacing: -.045em;
}

.art-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(70px, 11vh, 130px);
  align-items: start;
  justify-items: center;
  width: min(100%, 940px);
  margin: 0 auto;
}

.art-card { display: block; width: 100%; padding: 0; border: 0; background: transparent; text-align: left; cursor: zoom-in; }
.art-card:nth-child(even) { margin-top: 0; }
.art-card.wide, .art-card.portrait { grid-column: auto; width: 100%; justify-self: center; }

.art-card > img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  background: #f6f6f6;
  transition: transform .22s ease, box-shadow .22s ease;
}

.art-card:hover > img, .art-card:focus-visible > img { transform: translateY(-5px); box-shadow: 0 7px 0 rgb(17 17 17 / .5); }

.image-placeholder {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 4 / 3;
  border: 1px solid #aaa;
  background: #f3f3f3;
  color: #777;
  font-size: .78rem;
  letter-spacing: .12em;
  transition: transform .22s ease, box-shadow .22s ease;
}

.portrait .image-placeholder { aspect-ratio: 3 / 4; }
.wide .image-placeholder { aspect-ratio: 16 / 9; }
.art-card:hover .image-placeholder, .art-card:focus-visible .image-placeholder { transform: translateY(-5px); box-shadow: 0 7px 0 rgb(17 17 17 / .5); }
.art-card:focus-visible { outline: 2px dashed #111; outline-offset: 8px; }
.art-info { display: block; padding-top: 15px; }
.art-info strong { display: block; font-family: Georgia, "Times New Roman", serif; font-size: clamp(1.3rem, 2vw, 2rem); font-weight: 400; }
.art-info small { display: block; margin-top: 6px; font-size: .88rem; }

.modal[hidden] { display: none; }
.modal { position: fixed; inset: 0; z-index: 20; }
.modal-backdrop { position: absolute; inset: 0; width: 100%; border: 0; background: rgb(255 255 255 / .78); backdrop-filter: blur(5px); cursor: zoom-out; }

.modal-panel {
  position: absolute;
  inset: 4vh 3vw;
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(280px, .75fr);
  gap: clamp(28px, 5vw, 80px);
  overflow: auto;
  padding: clamp(28px, 4vw, 70px);
  border: 1px solid #111;
  background: #fff;
  box-shadow: 12px 12px 0 #111;
}

.modal-close { position: absolute; top: 14px; right: 18px; z-index: 2; padding: 0; border: 0; background: transparent; font-family: Georgia, serif; font-size: 2.4rem; cursor: pointer; }
.gallery { min-width: 0; }
.modal-image { display: grid; place-items: center; width: 100%; min-height: 58vh; background: #f3f3f3; }
.modal-image img { display: block; width: 100%; max-height: 68vh; object-fit: contain; }
.modal-image video { display: block; width: 100%; max-height: 68vh; background: #000; }
.modal-image img[hidden], .modal-image video[hidden] { display: none; }
.gallery-controls { display: flex; align-items: center; justify-content: center; gap: 22px; margin-top: 14px; }
.gallery-controls p { margin: 0; font-size: .82rem; }
.gallery-button { padding: 4px 9px; border: 0; background: transparent; font-size: 1.4rem; cursor: pointer; }
.gallery-button:hover, .gallery-button:focus-visible { text-decoration: underline; }
.thumbnails { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.thumbnail { padding: 8px 11px; border: 1px solid #111; background: transparent; color: #111; font-size: .75rem; cursor: pointer; }
.thumbnail.active { border-color: #111; background: transparent; color: #111; outline: 1px solid #111; outline-offset: 2px; }

.modal-copy { align-self: center; padding-right: 2vw; }
.modal-copy h2 { margin: 0 0 24px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(2.5rem, 5vw, 5.5rem); font-weight: 400; line-height: .9; }
.modal-details { margin: 0 0 38px; line-height: 1.6; }
#modal-description { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: 1.05rem; line-height: 1.65; }
body.modal-open { overflow: hidden; }

@media (max-width: 760px) {
  .sidebar { position: sticky; top: 0; width: 100%; min-width: 0; height: auto; padding: 16px 18px 13px; border: 0; overflow-x: auto; }
  .home-link { margin: 0 18px 13px 0; font-size: .75rem; }
  .sidebar nav { flex-direction: row; gap: 23px; width: max-content; }
  .category-link { font-size: .88rem; }
  .category-link:hover, .category-link:focus-visible, .category-link.active { transform: none; }
  .art-scroll { margin-left: 0; padding: 0 20px; }
  .category-section { min-height: 88vh; padding: 65px 0 100px; scroll-margin-top: 100px; }
  .art-grid { grid-template-columns: 1fr; gap: 70px; }
  .art-card:nth-child(even) { margin-top: 0; }
  .art-card.wide, .art-card.portrait { grid-column: auto; width: 100%; justify-self: auto; }
  .modal-panel { inset: 12px; grid-template-columns: 1fr; padding: 54px 20px 30px; gap: 34px; box-shadow: 6px 6px 0 #111; }
  .modal-image { min-height: 48vh; }
  .modal-copy { padding: 0 0 30px; }
}

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