* {
  box-sizing: border-box;
}

/* Full-height layout: header on top, content box fills the rest and scrolls on its own */
body {
  margin: 0;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background: #d9d9d9;
  color: #222;
  font-family: system-ui, sans-serif;
  line-height: 1.6;
}

/* Header and content share the same centered column, so the menu lines up with the content's left edge */
header,
main {
  width: min(760px, 100% - 32px);
  margin-left: auto;
  margin-right: auto;
}

header {
  padding: 16px 0;
}

/* Dropdown menu */
.menu {
  position: relative;
}

.menu summary {
  display: flex;
  width: 250px;
  list-style: none;
  cursor: pointer;
  padding: 8px 20px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
  font-weight: 600;
  user-select: none;
}

.menu summary::-webkit-details-marker {
  display: none;
}

.menu-label,
.menu a {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.menu-label {
  flex: 1;
  min-width: 0;
}

.menu summary::after {
  content: "▾";
  margin-left: 8px;
}

.menu[open] summary::after {
  content: "▴";
}

.menu ul {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 10;
  width: 250px;
  margin: 0;
  padding: 6px 0;
  list-style: none;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.menu a {
  display: block;
  padding: 8px 16px;
  color: #222;
  text-decoration: none;
}

.menu a:hover,
.menu a:focus-visible {
  background: #eee;
}

.menu a[aria-current="page"] {
  font-weight: 600;
}

/* Centered scrollable content section */
main {
  flex: 1;
  min-height: 0;
  margin-bottom: 16px;
  padding: 24px;
  overflow-y: auto;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
}

/* Background layer of scattered Cyrillic letters */
.letters {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  user-select: none;
}

.letters span {
  position: absolute;
  font-family: Georgia, "Times New Roman", serif;
  color: rgba(255, 255, 255, 0.45);
  line-height: 1;
}

.content-image {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
}

footer {
  padding: 0 16px 16px;
  text-align: center;
}

footer p {
  margin: 0;
  font-weight: 600;
}
