.hamburger {
  --w: 2rem;
  --h: 0.32rem;
  --gap: 0.3rem;
  align-items: center;
  backdrop-filter: blur(4px);
  /* background: var(--my-bg); */
  border-radius: 0.5rem;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: var(--gap);
  /* justify-content: center; */
  padding: 0.28rem;
  position: fixed;
  right: 1rem;
  top: 1rem;
  transition: gap 0.25s ease;
  z-index: 2000;
}

.hamburger span {
  background: var(--my-accent1);
  border-radius: 0.15rem;
  /* box-shadow: 0 0 4px var(--my-accent1); */
  height: var(--h);
  transform-origin: center;
  transition:
    transform 0.25s ease,
    opacity 0.25s ease,
    width 0.25s ease;
  width: var(--w);
}

/* --- OPEN STATE --- */

/*
  Collapse the 3 bars smoothly into one:
  - gap goes to zero
  - top & bottom bars move toward center
  - mid bar expands slightly
*/

@keyframes hamburger-glow-pulse {
  0% {
    box-shadow: 0 0 0.2rem var(--my-accent1);
    opacity: 0.85;
  }
  50% {
    box-shadow: 0 0 0.8rem var(--my-accent1);
    opacity: 1;
  }
  100% {
    box-shadow: 0 0 0.2rem var(--my-accent1);
    opacity: 0.85;
  }
}

body.drawer-open .hamburger {
  gap: 0;
}

body.drawer-open .hamburger span {
  animation: hamburger-glow-pulse 1.6s ease-in-out infinite;
}

body.drawer-open .hamburger span:nth-child(1) {
  transform: translateY(var(--h));
}

body.drawer-open .hamburger span:nth-child(2) {
  transform: translateY(0);
}

body.drawer-open .hamburger span:nth-child(3) {
  transform: translateY(calc(-1 * var(--h)));
}

.drawer {
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  backdrop-filter: blur(16px) saturate(1.2);
  background: rgba(255, 255, 255, 0.12);
  border-radius: 1rem;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.25),
    0 -8px 24px rgba(0, 0, 0, 0.35);
  height: 100vh;
  inset: 0;
  position: fixed;
  transform: translateX(-100%);
  transition: transform 0.3s ease;
  width: 100%;
  z-index: 1000;
}

.drawer-section {
  background: rgba(1, 1, 1, 0.2);
  border-radius: 1rem;
  margin-bottom: 1rem;
  padding: 1rem;
}

.drawer-section:last-child {
  margin-bottom: 0;
}

body.drawer-open .drawer {
  transform: translateX(0);
}

.drawer h2 {
  border-bottom: 0.1rem solid var(--my-accent1);
  color: var(--my-accent1);
  font-size: 1.25rem;
  font-weight: lighter;
  margin: 0;
  margin-bottom: 1.5rem;
  padding: 0;
  padding-bottom: 0.25rem;
}

/* Inner scrollable area */
.drawer-inner {
  box-sizing: border-box;
  height: 100%;
  margin: 0 auto;
  max-width: 60ch;
  overflow-y: auto;
  padding: 1rem;
  padding-bottom: 8rem;
  padding-top: 4rem;
}

/* --- Table of Contents --- */
#toc {
  align-items: flex-start;
  display: flex;
  flex-direction: column;
  font-family: "Courier New", Courier, monospace;
  margin: 0;
  padding: 0;
}

#toc a {
  border-radius: 0.5rem;
  display: block;
  margin-bottom: 0.5rem;
  padding: 0.25rem;
  text-decoration: none;
}

#toc a:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
}

#toc a:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--my-accent1);
  transition: none;
}

#toc a.active {
  color: var(--my-accent1);
  font-weight: bold;
}

/* --- ARTICLE LIST --- */

.articles-list nav {
  /* align-items: center; */
  display: flex;
  flex-direction: column;
  padding: 1rem;
}

.article-list a {
  /* background-color: var(--my-bg); */
  border: 1px solid var(--my-text-color1);
  border-radius: 1rem;
  display: block;
  font-weight: bold;
  margin-bottom: 1rem;
  padding: 0.5rem;
  text-align: center;
  text-transform: capitalize;
  transition: none;
}

.article-list a:hover {
  color: var(--my-accent1);
  outline: 1px solid var(--my-accent1);
  text-decoration: none;
}

.article-list a:last-child {
  margin-bottom: 0;
}
