* {
  font-family: "Roboto Mono", monospace;
  font-weight: 400;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  background: #fff;
  color: #000;
  padding: 2em;
  margin: 0;
  margin-bottom: 5em;
}

.italic-text {
  font-style: italic;
}

a {
  color: #000;
}

a.anchor {
  display: block;
  position: relative;
  top: -32px;
  visibility: hidden;
}

h1, h2, h3 {
  font-weight: 500;
  margin-top: 0;
  max-width: 800px;
}

h1 {
  font-size: 2rem;
  letter-spacing: -0.02em;
  margin-bottom: 0.25em;
}

h2 {
  font-size: 1.3rem;
  margin-top: 2em;
  margin-bottom: 1em;
}

header {
  margin-top: 0;
  margin-bottom: 3em;
  max-width: 800px;
}

.back-link {
  display: inline-block;
  margin-bottom: 1.5em;
  font-size: 0.95rem;
  text-decoration: none;
}

.back-link:hover {
  text-decoration: underline;
}

#menu {
  position: fixed;
  top: 1em;
  right: 0;
  padding: 1.5em;
  background-color: #fff;
  display: flex;
  flex-direction: column;
  z-index: 2;
}

section, footer {
  margin: 5em 0;
}

footer {
  max-width: 800px;
}

section p {
  max-width: 800px;
  line-height: 1.65;
  margin: 1.2em 0;
}

.statement {
  margin-bottom: 4em;
}

.statement-meta {
  font-size: 0.95rem;
  color: #444;
}

.external-link {
  display: inline-flex;
  align-items: center;
  gap: 0.2em;
}

/* Gallery layout */
.gallery {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 2.5em 1.5em;
  margin-top: 2.5em;
}

.artwork-card {
  margin: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
}

/* Below-the-fold cards defer layout calculations */
.artwork-card.deferred {
  content-visibility: auto;
  contain-intrinsic-size: auto none auto 450px;
}

.artwork-link {
  display: block;
  text-decoration: none;
  background: #f8f8f8;
  overflow: hidden;
  cursor: pointer;
  border: 1px solid #f0f0f0;
}

.artwork-link img {
  width: 100%;
  height: auto;
  display: block;
  transition: opacity 0.2s ease, transform 0.25s ease;
}

.artwork-link:hover img {
  opacity: 0.92;
  transform: scale(1.015);
}

.artwork-caption {
  margin-top: 0.85em;
  font-size: 0.85rem;
  line-height: 1.45;
  display: flex;
  flex-direction: column;
  gap: 0.2em;
}

.artwork-title {
  color: #000;
  font-size: 0.95rem;
}

.artwork-meta {
  color: #555;
  font-size: 0.8rem;
}

@media(min-width: 768px) {
  section {
    max-width: calc(100% - 180px);
  }

  .artwork-card {
    flex-basis: calc(50% - 0.75em);
    max-width: calc(50% - 0.75em);
  }

  a.anchor {
    top: -32px;
  }
}

@media(min-width: 992px) {
  .artwork-card {
    flex-basis: calc(33.333% - 1em);
    max-width: calc(33.333% - 1em);
  }
}

/* Signature loackme placeholder asterisk */
.gallery > .gallery-placeholder {
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 1.8rem;
  color: #000;
  flex-grow: 1;
  flex-basis: 0;
  max-width: none;
  min-height: 200px;
}

/* Lightbox Modal */
dialog.lightbox {
  border: 1px solid #000;
  padding: 1.5em;
  max-width: min(94vw, 1600px);
  max-height: 94vh;
  background: #fff;
  color: #000;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

dialog.lightbox::backdrop {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.lightbox-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.2em;
}

.lightbox-media {
  max-width: 100%;
  max-height: 72vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

.lightbox-media img {
  max-width: 100%;
  max-height: 72vh;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  transition: opacity 0.15s ease;
}

.lightbox-media img.pixel {
  image-rendering: pixelated;
}

.lightbox-bar {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1em;
  font-size: 0.85rem;
  border-top: 1px solid #eee;
  padding-top: 1em;
}

.lightbox-info {
  display: flex;
  flex-direction: column;
  gap: 0.2em;
}

.lightbox-title {
  font-weight: 500;
}

.lightbox-details {
  color: #666;
  font-size: 0.8rem;
}

.lightbox-controls {
  display: flex;
  align-items: center;
  gap: 0.8em;
}

.lightbox-btn {
  background: #fff;
  border: 1px solid #000;
  color: #000;
  font-family: inherit;
  font-size: 0.85rem;
  padding: 0.3em 0.8em;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
  text-decoration: none;
}

.lightbox-btn:hover {
  background: #000;
  color: #fff;
}

.lightbox-close-btn {
  border: none;
  background: none;
  font-size: 1.1rem;
  font-family: inherit;
  cursor: pointer;
  padding: 0.2em 0.5em;
}

.lightbox-close-btn:hover {
  text-decoration: underline;
}

@media(max-width: 767px) {
  body {
    padding: 1.25em;
  }

  header {
    margin-bottom: 1.5em;
  }

  #menu {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
    padding: 0;
    margin-top: 0.5em;
    margin-bottom: 2em;
    gap: 0.5em 1.2em;
    background-color: transparent;
  }

  .lightbox-bar {
    flex-direction: column;
    align-items: flex-start;
  }
}
