.site-shell {
  width: min(1500px, 100%);
  min-height: 100vh;
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) auto;
  align-items: center;
  gap: 1.25rem;
  padding: 0.9rem clamp(1rem, 4vw, 3rem);
  border-bottom: 1px solid rgb(255 255 255 / 9%);
  background: rgb(32 38 58 / 94%);
  backdrop-filter: blur(12px);
}

.site-logo {
  width: 130px;
  max-height: 62px;
  object-fit: contain;
  object-position: left center;
}

.site-heading {
  min-width: 0;
  text-align: center;
}

.site-heading h1 {
  margin: 0;
  font-family: var(--fancy-font);
  font-size: clamp(1.6rem, 3vw, 2.35rem);
  line-height: 1.15;
}

.site-heading p {
  margin: 0.2rem 0 0;
  color: var(--text-muted);
  font-size: clamp(1rem, 2vw, 1.35rem);
}

.language-selector {
  display: flex;
  justify-content: flex-end;
  gap: 0.45rem;
}

.language-button {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem;
  border: 2px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}

.language-button img {
  width: 36px;
  height: 24px;
  border-radius: 4px;
  object-fit: cover;
  box-shadow: 0 3px 8px rgb(0 0 0 / 25%);
}

.language-button span {
  display: none;
}

.language-button:hover,
.language-button.selected {
  border-color: var(--accent);
  background: rgb(255 255 255 / 7%);
}

.site-layout {
  display: grid;
  grid-template-columns: minmax(230px, 290px) minmax(0, 1fr);
  gap: clamp(1rem, 2.5vw, 2.5rem);
  padding: clamp(1rem, 3vw, 2.5rem);
}

.site-sidebar {
  position: sticky;
  top: 105px;
  align-self: start;
  max-height: calc(100vh - 125px);
  overflow: auto;
  padding-right: 0.35rem;
}

.curriculum-menu {
  display: grid;
  gap: 0.75rem;
}

.menu-group {
  overflow: hidden;
  border: 1px solid rgb(255 255 255 / 9%);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 6px 18px rgb(0 0 0 / 14%);
}

.menu-category,
.menu-chapter {
  width: 100%;
  border: 0;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.menu-category {
  position: relative;
  padding: 0.85rem 2.5rem 0.85rem 1rem;
  background: var(--surface-raised);
  font-weight: 600;
}

.menu-category::after {
  content: "▾";
  position: absolute;
  right: 1rem;
  transition: transform 160ms ease;
}

.menu-category[aria-expanded="false"]::after {
  transform: rotate(-90deg);
}

.menu-category:hover {
  background: var(--surface-active);
}

.menu-chapters {
  display: grid;
  padding: 0.35rem;
}

.menu-chapter {
  padding: 0.65rem 0.8rem;
  border-radius: 8px;
  background: transparent;
}

.menu-chapter:hover {
  background: rgb(255 255 255 / 8%);
}

.menu-chapter.selected {
  background: var(--surface-active);
  box-shadow: inset 4px 0 0 var(--accent);
}

.report-link {
  display: block;
  margin-top: 1rem;
  padding: 0.75rem 0.9rem;
  border-radius: 10px;
  background: var(--purple);
  color: white;
  text-align: center;
  text-decoration: none;
  font-weight: 600;
}

.report-link:hover {
  background: #ad6097;
  color: white;
}

.site-main {
  min-width: 0;
}

.quiz-launcher {
  position: fixed;
  right: clamp(1rem, 4vw, 3rem);
  bottom: clamp(1rem, 4vw, 2.5rem);
  z-index: 20;
  max-width: min(260px, calc(100vw - 2rem));
  padding: 0.8rem 1.1rem;
  border: 0;
  border-radius: 12px;
  background: var(--purple);
  color: white;
  box-shadow: var(--shadow);
  font-weight: 600;
  cursor: pointer;
}

.quiz-launcher:hover {
  background: #ad6097;
  transform: translateY(-2px);
}

@media (max-width: 850px) {
  .site-header {
    position: static;
    grid-template-columns: 90px minmax(0, 1fr);
  }

  .site-logo {
    width: 86px;
  }

  .language-selector {
    grid-column: 1 / -1;
    justify-content: center;
  }

  .language-button span {
    display: inline;
  }

  .site-layout {
    grid-template-columns: 1fr;
  }

  .site-sidebar {
    position: static;
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }
}

@media (max-width: 520px) {
  .site-header {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .site-logo {
    display: none;
  }

  .language-button span {
    display: none;
  }
}
