:root {
  --site-paper: #fbf0df;
  --site-coral: #ee5e66;
  --site-coral-deep: #d94052;
  --site-ink: #202120;
  --site-teal: #43b4c3;
  --site-line: rgb(61 45 34 / 18%);
  --site-max: 1460px;
}

.article-body {
  margin: 0;
  min-width: 320px;
  color: var(--site-ink);
  background: var(--site-paper);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

.article-skip {
  position: fixed;
  z-index: 1000;
  top: 8px;
  left: 8px;
  padding: 10px 14px;
  color: #fff;
  background: var(--site-ink);
  border-radius: 8px;
  font: 800 12px/1 Inter, sans-serif;
  transform: translateY(-160%);
}

.article-skip:focus {
  transform: none;
}

.site-header,
.site-header *,
.article-pager,
.article-pager *,
.article-sitefooter,
.article-sitefooter * {
  box-sizing: border-box;
}

.site-header {
  position: relative;
  z-index: 20;
  display: grid;
  grid-template-columns: 260px 1fr 56px;
  gap: 28px;
  align-items: center;
  height: 78px;
  padding: 0 max(30px, calc((100vw - var(--site-max)) / 2));
  color: var(--site-ink);
  background: rgb(251 240 223 / 96%);
  border-bottom: 1px solid var(--site-line);
}

.site-header .brand {
  display: inline-flex;
  align-items: baseline;
  width: max-content;
  color: var(--site-coral-deep);
  font: 800 34px/1 "Shantell Sans", cursive;
  letter-spacing: -3px;
  text-decoration: none;
  transform: rotate(-2deg);
  text-shadow: 1px 1px 0 rgb(255 255 255 / 70%);
}

.site-header .brand span {
  transform: translateY(-2px);
}

.site-header .brand b {
  font-weight: 800;
  transform: translateY(3px) rotate(2deg);
}

.site-header nav {
  display: flex;
  gap: clamp(22px, 4vw, 62px);
  align-items: center;
  justify-content: center;
  height: 100%;
}

.site-header nav a {
  position: relative;
  display: grid;
  place-items: center;
  height: 100%;
  color: inherit;
  font: 700 16px/1 Oswald, sans-serif;
  letter-spacing: 0.03em;
  text-decoration: none;
  white-space: nowrap;
}

.site-header nav a::after {
  position: absolute;
  right: 3px;
  bottom: 13px;
  left: 3px;
  height: 9px;
  background: url("../assets/hero-coral-chalk-line-v2.webp") center / 100% 100% no-repeat;
  content: "";
  mix-blend-mode: multiply;
  transform: scaleX(0) rotate(-2deg);
  transition: transform 200ms ease;
}

.site-header nav a:hover::after,
.site-header nav a.active::after {
  transform: scaleX(1) rotate(-2deg);
}

.header-telegram {
  display: grid;
  place-items: center;
  width: 50px;
  aspect-ratio: 1;
  color: #fff;
  background: var(--site-teal);
  border: 2px solid var(--site-ink);
  border-radius: 50%;
  box-shadow: 3px 4px 0 rgb(32 33 32 / 20%);
  transform: rotate(-4deg);
  transition: transform 200ms ease;
}

.header-telegram svg {
  width: 29px;
  height: 29px;
  fill: currentColor;
  transform: translate(-1px, 1px);
}

.header-telegram:hover {
  transform: rotate(5deg) scale(1.07);
}

.site-header a:focus-visible,
.article-pager a:focus-visible,
.article-sitefooter a:focus-visible {
  outline: 3px solid var(--site-teal);
  outline-offset: 4px;
}

.article-body--ology .cr-page,
.article-body--supremacy .crx {
  overflow: clip;
}

.article-body--ology .cr-layout,
.article-body--supremacy .crx-layout {
  grid-template-columns: minmax(0, 760px);
  gap: 0;
  justify-content: center;
}

.article-body--ology .cr-figure img,
.article-body--supremacy .crx-figure img {
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

/* Every article stays on the same light, readable site surface. */
.article-body--supremacy,
.article-body--supremacy .crx {
  --bg: #fff6fa;
  --paper: #fff;
  --ink: #111;
  --muted: #6d6670;
  color: #111;
  background-color: #fff6fa;
}

.article-body--supremacy .crx-deck,
.article-body--supremacy .crx-toc a,
.article-body--supremacy .crx-card span,
.article-body--supremacy .crx-footer {
  color: #6d6670;
}

.article-body--supremacy .crx-strip span {
  display: inline-block;
  min-width: max-content;
  animation: crx-strip-scroll 28s linear infinite;
  will-change: transform;
}

@keyframes crx-strip-scroll {
  to {
    transform: translateX(-25%);
  }
}

.article-pager {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 24px;
  align-items: stretch;
  width: min(1120px, calc(100% - 36px));
  margin: 42px auto 56px;
  padding: 24px 0;
  color: var(--site-ink);
  border-block: 1px solid rgb(23 21 22 / 32%);
  font-family: Inter, sans-serif;
}

.article-pager a {
  color: inherit;
  text-decoration: none;
}

.article-pager-link {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 94px;
  padding: 14px 18px;
  background: rgb(255 255 255 / 56%);
  border: 1px solid rgb(23 21 22 / 30%);
  border-radius: 18px;
  transition: 160ms ease;
}

.article-pager-link:hover {
  background: #fff;
  border-color: var(--site-ink);
  box-shadow: 4px 4px 0 var(--site-coral);
  transform: translate(-2px, -2px);
}

.article-pager-link small {
  margin-bottom: 9px;
  color: var(--site-coral);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.1em;
}

.article-pager-link b {
  overflow: hidden;
  font-size: 15px;
  line-height: 1.26;
  text-overflow: ellipsis;
}

.article-pager-next {
  text-align: right;
}

.article-pager-home {
  display: grid;
  place-content: center;
  min-width: 135px;
  text-align: center;
}

.article-pager-home span {
  color: var(--site-coral);
  font-size: 24px;
}

.article-pager-home b {
  margin-top: 4px;
  font-size: 11px;
  letter-spacing: 0.07em;
}

.article-sitefooter {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 25px max(18px, calc((100vw - 1120px) / 2));
  color: var(--site-ink);
  background: var(--site-paper);
  border-top: 1px solid rgb(23 21 22 / 18%);
  font: 800 10px/1.2 Inter, sans-serif;
  letter-spacing: 0.08em;
}

.article-sitefooter a {
  color: inherit;
  text-decoration: none;
}

@media (max-width: 1180px) {
  .site-header {
    grid-template-columns: 210px 1fr 50px;
  }

  .site-header nav {
    gap: 22px;
  }

  .site-header nav a {
    font-size: 14px;
  }
}

@media (max-width: 880px) {
  .site-header {
    grid-template-columns: 1fr 48px;
    height: 68px;
    padding-inline: 17px;
  }

  .site-header .brand {
    font-size: 32px;
  }

  .site-header nav {
    display: none;
  }

  .header-telegram {
    width: 44px;
  }
}

@media (max-width: 720px) {
  .article-pager {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    width: calc(100% - 24px);
  }

  .article-pager-home {
    grid-column: 1 / -1;
    grid-row: 1;
    min-height: 48px;
  }

  .article-pager-link {
    min-height: 112px;
    padding: 12px;
  }

  .article-pager-link b {
    font-size: 13px;
  }

  .article-sitefooter {
    align-items: center;
    padding-inline: 12px;
    text-align: center;
  }

  .article-sitefooter span {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .site-header *,
  .article-pager *,
  .article-body--supremacy .crx-strip span {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }
}

@media print {
  .site-header,
  .article-pager,
  .article-sitefooter,
  .article-skip {
    display: none !important;
  }
}
