* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

body {
  background: black;
  display: flex;
  font-family: "Baskervville", serif;
  font-size: 22px;
  color: #eaeaea;
  overflow-x: hidden;
}

/* Canvas */
.canvas {
  width: 100%;
  min-height: 100vh;
  display: flex;
  background: black;
}

/* Sidebar */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 40%;
  height: 100vh;

  padding-left: 16px;
  padding-top: 72px;
  padding-bottom: 0px;

  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* Title */
.top h1 {
  font-size: 24px;
  font-weight: 400;
  line-height: 1.35;
  letter-spacing: 0.02em;
  margin-bottom: 0px; /* slightly tighter */
}

/* Navigation */
nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

nav a {
  font-style: italic;
  text-decoration: none;
  color: #eaeaea;
}

nav a:hover {
  opacity: 0.7;
}

/* Footer */
.footer {
  font-size: 16px;
  margin-top: auto;
  padding-bottom: 4px;
  display: flex;
  gap: 12px;
  /* justify-content: center; */
}

.footer a {
  text-decoration: none;
  color: #eaeaea;
}

.footer a:hover {
  opacity: 0.7;
}

/* Image */
.image-panel {
  margin-left: 40%;
  width: 60%;
}

.image-panel img {
  width: 100%;
  object-fit: contain;
}

@media (max-width: 700px) {
  /* Stack vertically in source order: sidebar/text first, then image */
  .canvas {
    flex-direction: column;
  }

  /* Sidebar becomes normal flow (not fixed) and fills the viewport height,
     so the footer can sit at the bottom on short pages (sticky footer pattern). */
  .sidebar {
    position: relative;
    width: 100%;
    height: auto;
    min-height: 100vh;

    padding-left: 16px;
    padding-top: 24px;
    padding-bottom: 16px;

    display: flex;
    flex-direction: column;
  }

  /* Make the top content take remaining space, pushing the footer down */
  .top {
    flex: 1;
  }

  .footer {
    margin-top: auto;
    gap: 16px;
  }

  /* Image becomes full width and is not offset */
  .image-panel {
    margin-left: 0;
    width: 100%;
  }

  /* Show entire image (no cropping) */
  .image-panel img {
    width: 100%;
    height: auto;
    object-fit: contain;
    display: block;
  }

  /* Optional readability */
  body {
    font-size: 18px;
  }

  .top h1 {
    font-size: 20px;
  }
}
