:root {
  --page-bg: #fcfbf7;
  --surface: #ffffff;
  --surface-muted: #f6f4ef;
  --border: #ebe6dc;
  --border-strong: #d7d2c7;
  --text-main: #17181c;
  --text-soft: #92959d;
  --text-muted: #b1b3b8;
  --accent: #1f3658;
  --accent-soft: rgba(31, 54, 88, 0.12);
  --drop-fill: #eef4ff;
  --drop-stroke: #bdd1f2;
  --card-blue: #eaf2ff;
  --shadow-soft: 0 18px 44px rgba(23, 24, 28, 0.06);
  --radius-card: 18px;
  --radius-pill: 999px;
  --header-height: 88px;
  --toc-width: 190px;
  --content-width: 700px;
  --content-gap: 160px;
  --page-padding-x: 48px;
  --page-padding-y: 22px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    linear-gradient(90deg, #fffdfb 0, #fffdfb 32%, #ffffff 32%, #ffffff 100%);
  color: var(--text-main);
  font-family: "Manrope", sans-serif;
}

img,
svg,
video {
  display: block;
  max-width: 100%;
}

button,
input,
textarea,
select {
  font: inherit;
}

a {
  color: inherit;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.page-shell {
  min-height: 100vh;
  padding: 0 0 72px;
}

.site-header {
  position: relative;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: auto;
  margin: 0 0 52px;
  margin-bottom: 52px;
  padding: 30px;
}

.brand-link {
  display: inline-flex;
  align-items: center;
}

.brand-link {
  gap: 14px;
  color: var(--text-soft);
  text-decoration: none;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 4px solid #000;
  border-radius: 999px;
  background: transparent;
  color: #000;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.brand-copy {
  max-width: 0;
  overflow: hidden;
  opacity: 0;
  font-size: 0.95rem;
  font-weight: 400;
  white-space: nowrap;
  transition:
    max-width 220ms ease,
    opacity 180ms ease;
}

.brand-link:hover .brand-copy,
.brand-link:focus-visible .brand-copy {
  max-width: 180px;
  opacity: 1;
}


.toc-title {
  margin: 0 0 10px;
  color: var(--text-soft);
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0;
}

.toc-list {
  display: grid;
  gap: 2px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.toc-link {
  display: block;
  width: 100%;
  border: 0;
  background: transparent;
  padding: 5px 0;
  border-radius: 0;
  color: #8f9298;
  font-size: 0.86rem;
  font-weight: 500;
  line-height: 1.5;
  text-align: left;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition:
    color 160ms ease,
    transform 160ms ease;
}

.toc-link:hover,
.toc-link:focus-visible,
.toc-link.is-active {
  color: var(--text-main);
  font-weight: 700;
  transform: none;
  outline: none;
}

.toc-link.is-active {
  color: #3b82f6 !important;
}

.toc-list .toc-item--level-2 .toc-link {
  color: #5d6067;
  font-size: 0.9rem;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.toc-list .toc-item--level-3 .toc-link {
  padding-left: 20px;
  color: #9ca0a8;
  text-decoration: none;
}

.toc-list .toc-item--level-4 .toc-link {
  padding-left: 34px;
  color: #a9adb4;
  text-decoration: none;
}

.toc-empty {
  margin: 14px 0 0;
  color: var(--text-soft);
  font-size: 0.95rem;
  line-height: 1.6;
}

@media (max-width: 1100px) {
  :root {
    --content-gap: 88px;
    --page-padding-x: 24px;
  }
}

@media (max-width: 820px) {
  :root {
    --header-height: 84px;
    --page-padding-x: 18px;
    --page-padding-y: 18px;
  }

  .page-shell {
    padding-bottom: 90px;
  }

  .site-header {
    margin-bottom: 28px;
    padding: 20px;
  }

  .header-actions {
    gap: 10px;
  }

  .draft-label {
    display: none;
  }

  .brand-mark {
    width: 46px;
    height: 46px;
    font-size: 0.98rem;
  }

  .brand-copy,
  .save-button {
    min-height: 44px;
    padding: 0 14px;
  }

  .brand-copy {
    font-size: 0.88rem;
  }

  .toc-title {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
  }
}
