.header {
  background-color: var(--color-secondary);
  border-block-end: var(--border);
  position: fixed;
  z-index: var(--z-top);
  padding: var(--step-0);
  width: var(--pageWidth);
}

.header .main {
  display: flex;
  gap: var(--step--1);
  justify-content: space-between;
  align-items: center;
}

.header .title {
  font-family: var(--font-secondary);
  font-size: calc(2.4rem + 1vw);
  font-weight: 350;
  letter-spacing: -0.036em;
  line-height: 0.8;
}

.header .tagline-container {
  display: inline-flex;
  gap: var(--step--2);
  align-items: end;
  margin-block-start: var(--step--4);
}

.header .tagline {
  font-size: min(1.8rem, 6vw);
  line-height: 0.8;
  letter-spacing: -0.02em;
}

.toc-toggle {
  display: flex;
  align-items: center;
  gap: var(--step-0);
  position: relative;
  z-index: var(--z-top);
}

.toc-toggle:hover {
  cursor: pointer;
}

.header .toc-toggle span {
  font-size: 0.875rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--color-primary);
  text-align: end;
}

.toc-toggle .icon {
  position: relative;
  width: 28px;
  height: 18px;
}

.toc-toggle .line {
  position: absolute;
  width: 100%;
  height: 1px;
  background: var(--color-primary);
  transform-origin: center;
  transition: all 160ms ease-in-out;
}

.toc-toggle .line:nth-of-type(1) {
  top: 0%;
}

.toc-toggle .line:nth-of-type(2) {
  top: 50%;
  opacity: 1;
}

.toc-toggle .line:nth-of-type(3) {
  top: 100%;
}

.toc-toggle [data-active="true"] .line:nth-of-type(1) {
  transform: translateY(10px) rotate(45deg);
}

.toc-toggle [data-active="true"] .line:nth-of-type(2) {
  opacity: 0;
}

.toc-toggle [data-active="true"] .line:nth-of-type(3) {
  transform: translateY(-8px) rotate(-45deg);
  width: 100%;
}

.header .toc-container::part(panel) {
  background: #F7F4EC;
  border-inline-start: var(--border);
  justify-content: center;
  inset-block-start: var(--mask-size);
  inset-inline-end: calc(var(--mask-size) + 1px);
  width: min(100%, 30rem);
  height: var(--pageHeight);
}

.header .toc-container::part(body) {
  display: flex;
  align-items: center;
  margin-inline: var(--step-2);
}

.header .toc {
  display: flex;
  flex-direction: column;
  gap: var(--step-2);
}

.header .toc .link-list {
  margin-block-start: var(--step-0);
}

.header .toc .link-list li + li {
  margin-block-start: var(--step--1);
}

.header .toc .link-list a {
  font-family: var(--font-secondary);
  font-size: 1.125rem;
  font-weight: 450;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--color-primary);
  margin-block-start: var(--step-3);
}

.header .toc .link-list [data-active="true"] {
  font-weight: 600;
}

.header .toc .h3 {
  font-size: 1.2rem;
  margin-inline-start: var(--step-0);
}

.header .toc .h4 {
  font-size: 1rem;
  margin-inline-start: var(--step-2);
}

.header .toc .outer {
  display: flex;
  flex-direction: column;
}

@media (min-width: 72em) {
  .header {
    background: none;
    border-block-end: none;
    padding: var(--step-0) var(--step-1);
  }

  .header .tagline-container {
    margin-block-start: 0;
  }
}
