body {
  margin: 0;
  padding: 0;
  font-family: 'Baskervville', serif;
  color: #222;
  background-image: url("https://raw.githubusercontent.com/Wrensul/github.io/main/assets/background.jpg");
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  background-repeat: no-repeat;
}

header {
  background-image: url("https://blob.gifcities.org/gifcities/VYGG3MVKZNH7B3UEMCLADIJLOSJ2IVNW.gif");
  background-size: cover;
  background-position: center;
  border-bottom: 3px double #000;
  padding: 40px;
  text-align: center;
  box-shadow: inset 0 0 10px #aaa;
}

.site-title {
  font-size: 3em;
  font-weight: bold;
  margin: 0;
  text-shadow: 2px 2px 4px #fff;
  background-color: rgba(255,255,255,0.85);
  display: inline-block;
  padding: 10px 20px;
  border: 2px dashed #666;
}

nav ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: center;
  margin: 20px 0 0 0;
  padding: 0;
  font-family: "Courier New", monospace;
}

nav a {
  text-decoration: none;
  color: #000;
  background-color: #ffe;
  padding: 4px 8px;
  border: 2px outset #ccc;
  font-weight: bold;
}

nav a:hover {
  color: #900;
  text-decoration: underline wavy #900;
  background-color: #fffbe0;
}

.divider {
  border-top: 2px dashed #555;
  margin: 10px 0 20px;
}

.content {
  background-image: url("https://blob.gifcities.org/gifcities/BXSEWKELIKS4QP5GD7IBTDUHN22ZPTTI.gif");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-color: transparent;
  max-width: 800px;
  margin: 0 auto;
  padding: 40px 30px;
  border: 4px groove #222;
  box-shadow: 4px 4px 8px #555;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.toc {
  list-style-type: upper-roman;
  font-size: 1.25em;
  background-color: rgba(255,255,255,0.85);
  padding: 30px;
  border: 4px groove #222;
  box-shadow: 4px 4px 8px #555;
  text-align: center;
  list-style-position: inside;
}

.toc li {
  margin-bottom: 10px;
}

.toc a {
  color: #000066;
  text-decoration: underline;
}

.toc a:hover {
  color: #cc0000;
  background-color: #fffae0;
}

.decogifs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 40px auto;
}

.decogifs img {
  height: 60px;
}

.page {
  max-width: 900px;
  margin: 0 auto;
  padding: 30px;
  background-color: rgba(255, 255, 255, 0.85);
  border: 4px ridge #333;
  box-shadow: 6px 6px 10px #444;
}

.intro {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: center;
}

.square-placeholder {
  width: 200px;
  height: 200px;
  background: black;
  border: 2px solid #444;
  box-shadow: 3px 3px 8px #888;
}

.title-block {
  flex-grow: 1;
}

.tagline {
  font-style: italic;
  margin-top: 5px;
  color: #333;
}

.gallery {
  margin-top: 40px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.gallery-img {
  aspect-ratio: 1 / 1;
  background-color: black;
  border: 1px solid #888;
  box-shadow: 2px 2px 6px #aaa;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.gallery-img:hover {
  transform: scale(1.02);
}

#modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

#modal.hidden {
  display: none;
}

.modal-content {
  background: #fffefc;
  padding: 20px;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  box-shadow: 0 0 20px #000;
  position: relative;
  border: 4px double #333;
}

.modal-content img {
  max-width: 50%;
  max-height: 80vh;
}

#modal-poem {
  font-style: italic;
  max-width: 40%;
  overflow-y: auto;
  line-height: 1.4em;
  color: #111;
}

#modal-close {
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 24px;
  font-weight: bold;
  cursor: pointer;
  color: #900;
  background: #fff;
  padding: 2px 8px;
  border: 2px outset #999;
}

@media (max-width: 700px) {
  nav ul {
    flex-direction: column;
    gap: 10px;
  }

  .content {
    flex-direction: column;
    align-items: stretch;
  }

  img[alt="dragon left"],
  img[alt="dragon right"] {
    display: none;
  }

  .modal-content {
    flex-direction: column;
    align-items: center;
  }

  .modal-content img,
  #modal-poem {
    max-width: 100%;
  }

  .gallery {
    grid-template-columns: repeat(2, 1fr);
  }
}
