:root {
  --blog-ink: #121212;
  --blog-muted: #6d6d6d;
  --blog-rule: #dedede;
  --blog-red: #d82027;
}

body:has(.blog-page) {
  background: #fff;
  background-image: none;
}

.page-shell:has(.blog-page) {
  width: 100%;
  align-self: stretch;
}

.blog-hero {
  width: 100%;
  min-height: 25rem;
  margin-left: 0;
  padding: 10.5rem 0 7.4rem;
  color: #fff;
  background:
    url("../img/noise-mono-25.webp"),
    linear-gradient(110deg, rgba(148, 31, 31, 0.96), rgba(83, 15, 15, 0.96));
  background-size: 205px 205px, auto;
}

.blog-hero__inner {
  width: min(100% - 8rem, 87.5rem);
  margin: 0 auto;
}

.blog-hero__title {
  width: 100%;
  max-width: 100%;
  margin: 0;
  overflow: hidden;
  font-family: "Inter", Arial, sans-serif;
  font-size: clamp(3.6rem, 7vw, 6.8rem);
  font-weight: 750;
  line-height: 0.91;
  letter-spacing: -0.03em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.blog-page {
  width: 100%;
  padding: 0;
  color: var(--blog-ink);
  background: #fff;
}

.blog-layout {
  display: grid;
  grid-template-columns: minmax(9rem, 13rem) minmax(0, 47rem) minmax(10rem, 13rem);
  column-gap: clamp(2rem, 4vw, 5.5rem);
  align-items: start;
  width: min(100% - 8rem, 87.5rem);
  margin: 0 auto;
}

.toc-sidebar {
  position: sticky;
  top: 9rem;
  padding-top: 5.75rem;
}

.toc-sidebar__label,
.blog-kicker,
.author-card__meta,
.scroll-next__sub {
  margin: 0;
  font-family: "Inter", Arial, sans-serif;
  font-size: 0.67rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.toc-sidebar__label { color: var(--blog-muted); margin-bottom: 1rem; }

.toc-list { display: flex; flex-direction: column; border-left: 1px solid var(--blog-rule); }

.toc-link {
  display: block;
  margin-left: -1px;
  padding: 0.5rem 0 0.5rem 0.75rem;
  border-left: 2px solid transparent;
  color: #777;
  font-family: "Inter", Arial, sans-serif;
  font-size: 0.72rem;
  line-height: 1.35;
  text-decoration: none;
  transition: color 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.toc-link:hover { color: var(--blog-ink); }
.toc-link[data-toc-depth="3"] { padding-left: 1.2rem; font-size: 0.68rem; }
.toc-link[data-toc-status="active"] { border-color: var(--blog-red); color: var(--blog-ink); transform: translateX(0.15rem); }

.toc-article { min-width: 0; }
.blog-article__cover { position: relative; z-index: 1; margin: -5.8rem 0 3rem; aspect-ratio: 1.58 / 1; overflow: hidden; border-radius: 1.5rem; background: #e9e9e9; }
.blog-article__cover img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 44%; }

.toc-article h2, .toc-article h3, .toc-article p, .toc-article li, .toc-article blockquote { color: var(--blog-ink); }
.toc-article h2 { margin: 4.1rem 0 1.1rem; font-family: "Inter", Arial, sans-serif; font-size: clamp(2.25rem, 3.2vw, 3.35rem); font-weight: 500; line-height: 0.98; letter-spacing: -0.03em; }
.blog-heading__last-word { font-family: "Newsreader", Georgia, serif; font-style: italic; }
.toc-article h3 { margin: 2.4rem 0 0.7rem; font-family: "Inter", Arial, sans-serif; font-size: 1.05rem; font-weight: 700; letter-spacing: -0.025em; }
.toc-article p, .toc-article li { font-family: "Inter", Arial, sans-serif; font-size: 1rem; line-height: 1.8; }
.toc-article p { margin: 0 0 1.3rem; }
.toc-article ul { padding-left: 1.25rem; margin: 1.6rem 0; }
.toc-article li { margin-bottom: 0.6rem; }
.toc-article blockquote { margin: 2.5rem 0; padding: 0.25rem 0 0.25rem 1.4rem; border-left: 2px solid var(--blog-red); font-family: "Newsreader", Georgia, serif; font-size: 1.45rem; font-style: italic; line-height: 1.25; }

.author-card { position: sticky; top: 9rem; display: flex; align-items: center; gap: 0.75rem; padding-top: 5.75rem; }
.author-card__portrait { flex: 0 0 2.85rem; width: 2.85rem; height: 2.85rem; overflow: hidden; border-radius: 50%; background: #dedede; }
.author-card__portrait img { width: 100%; height: 100%; object-fit: cover; object-position: 36% 30%; transform: scale(1.45); }
.author-card__name { margin: 0 0 0.2rem; font-size: 0.78rem; font-weight: 750; line-height: 1.2; }
.author-card__meta { color: var(--blog-muted); font-size: 0.58rem; letter-spacing: 0.1em; }

.scroll-next {
  position: relative;
  width: 100%;
  min-height: 200vh;
  margin-top: 8rem;
  margin-left: 0;
  color: #fff;
  background: #111;
}
.scroll-next__inner { position: sticky; top: 0; display: flex; width: 100%; height: 100dvh; align-items: center; justify-content: center; overflow: hidden; color: inherit; text-align: center; text-decoration: none; }
.scroll-next__bg { position: absolute; z-index: 0; inset: 0; overflow: hidden; background: #111; }
.scroll-next__bg-img { display: block; width: 100%; height: 100%; object-fit: cover; transform: scale(1); will-change: transform; }
.scroll-next__bg-overlay { position: absolute; z-index: 1; inset: 0; background: #000; opacity: .65; }
.scroll-next__center { z-index: 2; display: flex; flex-flow: column; align-items: center; padding: 0 2rem; }
.scroll-next__sub { color: rgba(255,255,255,.68); }
.scroll-next__h { display: -webkit-box; box-sizing: border-box; max-width: 22ch; margin: 1.1rem 0 0; padding: .1em 0 .16em; overflow: hidden; font-family: "Inter", Arial, sans-serif; font-size: clamp(2.8rem, 5vw, 5rem); font-weight: 500; line-height: 1; letter-spacing: -0.03em; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; }
.scroll-next__progres { position: absolute; z-index: 1; width: min(29rem, 76vw); color: #fff; }
.scroll-next__progres-svg { display: block; width: 100%; overflow: visible; transform: rotate(-90deg); }

@media (max-width: 991px) {
  .blog-hero { min-height: 22rem; padding: 9.5rem 0 6.3rem; }
  .blog-hero__inner { width: min(100% - 4rem, 58rem); }
  .blog-layout { width: min(100% - 4rem, 58rem); grid-template-columns: 10rem minmax(0, 1fr); column-gap: 2.5rem; }
  .author-card { grid-column: 2; grid-row: 1; position: static; justify-self: end; margin-bottom: 2.25rem; padding: 0; }
  .toc-article { grid-column: 2; }
  .toc-sidebar { grid-row: span 2; }
}

@media (max-width: 700px) {
  .blog-hero { min-height: 18rem; padding: 7.6rem 0 5rem; }
  .blog-hero__inner { width: min(100% - 2.5rem, 37rem); }
  .blog-layout { display: flex; flex-direction: column; width: min(100% - 2.5rem, 37rem); }
  .toc-sidebar { position: static; width: 100%; padding: 0; order: 2; }
  .author-card { order: 1; align-self: flex-start; margin: 0 0 1.5rem; }
  .toc-article { order: 0; }
  .blog-hero__title { max-width: 100%; font-size: clamp(3.15rem, 14vw, 4.7rem); }
  .blog-article__cover { margin: -2.8rem 0 2.3rem; border-radius: 1rem; aspect-ratio: 1.25 / 1; }
  .toc-article h2 { margin-top: 3.25rem; }
  .scroll-next { min-height: 200vh; margin-top: 5rem; }
}

@media (prefers-reduced-motion: reduce) { .toc-link { transition: none; } }
