.blog-main {
  position: relative;
  isolation: isolate;
}

.blog-glow {
  position: absolute;
  inset: 0 0 auto;
  z-index: -1;
  height: 720px;
  overflow: hidden;
  pointer-events: none;
}

.blog-glow__frame {
  position: absolute;
  left: 50%;
  top: 0;
  width: max(1440px, 100%);
  height: 100%;
  transform: translateX(-50%);
}

.blog-glow__frame i {
  position: absolute;
  border-radius: 50%;
}

.blog-glow__frame i:nth-child(1) {
  left: -13.958%;
  top: -329px;
  width: 127.917%;
  height: 842px;
  background: var(--sky);
  filter: blur(36px);
}

.blog-glow__frame i:nth-child(2) {
  left: -13.958%;
  top: -645px;
  width: 127.986%;
  height: 1056px;
  background: var(--blue-500);
  filter: blur(60px);
}

.blog-glow__frame i:nth-child(3) {
  left: -13.403%;
  top: -375px;
  width: 127.917%;
  height: 598px;
  background: #000;
  filter: blur(75px);
}

.blog-glow__frame::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.12;
  mix-blend-mode: overlay;
  -webkit-mask-image: linear-gradient(#000 0, #000 300px, transparent 520px);
  mask-image: linear-gradient(#000 0, #000 300px, transparent 520px);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.blog-hero {
  padding-top: 247px;
  color: var(--white);
}

.blog-hero__eyebrow {
  font-size: 16px;
  line-height: 24px;
  font-weight: 500;
  color: var(--surface);
}

.blog-hero__title {
  max-width: 700px;
  margin-top: 20px;
  font-size: 48px;
  line-height: 54px;
  font-weight: 600;
  letter-spacing: -0.5px;
}

.blog-hero__text {
  max-width: 480px;
  margin-top: 24px;
}

.blog-layout {
  display: grid;
  grid-template-columns: clamp(200px, 20%, 240px) minmax(0, 1fr);
  column-gap: clamp(32px, 5.3334%, 64px);
  align-items: start;
  margin-top: 42px;
  padding-bottom: 91px;
}

.blog-cats {
  position: sticky;
  top: 104px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.blog-cats__title {
  font-size: 24px;
  line-height: 32px;
  font-weight: 500;
}

.blog-cats__list {
  display: flex;
  flex-direction: column;
}

.blog-cat {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  width: 100%;
  height: 44px;
  padding: 12px 16px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--grey);
  font-size: 16px;
  line-height: 20px;
  text-align: left;
  white-space: nowrap;
  transition: color 0.3s, background-color 0.3s, transform 0.4s var(--ease-spring);
  -webkit-tap-highlight-color: transparent;
}

.blog-cat::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  opacity: 0;
  transition: opacity 0.35s;
}

.blog-cat.is-active {
  color: var(--blue);
}

.blog-cat:focus-visible {
  outline: 2px solid var(--sky);
  outline-offset: 2px;
}

@media (hover: hover) {
  .blog-cat:hover {
    color: var(--blue);
    background-color: var(--surface);
  }
}

.blog-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: start;
  gap: 64px 32px;
}

.post-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-width: 0;
}

.post-card[hidden] {
  display: none !important;
}

.post-card--featured {
  grid-column: 1 / -1;
}

.post-card__media {
  position: relative;
  z-index: 2;
  display: block;
  overflow: hidden;
  aspect-ratio: 432 / 300;
  background: var(--surface-2);
}

.post-card--featured .post-card__media {
  aspect-ratio: 896 / 450;
}

.post-card--related .post-card__media {
  aspect-ratio: 584 / 300;
}

.post-card__media picture {
  display: contents;
}

.post-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 1.1s var(--ease);
}

.post-card__body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.post-card__info {
  display: flex;
  align-items: center;
  gap: 16px;
}

.post-card__tag {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 8px;
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--grey);
  font-size: 14px;
  line-height: 17.6px;
  font-weight: 500;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.post-card__time {
  color: var(--grey);
  font-size: 14px;
  line-height: 20px;
  white-space: nowrap;
}

.post-card__summary {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.post-card__title {
  font-size: 24px;
  line-height: 32px;
  font-weight: 600;
  transition: color 0.35s;
}

.post-card--featured .post-card__title {
  font-size: 40px;
  line-height: 54px;
  letter-spacing: -0.5px;
}

.post-card__excerpt {
  display: -webkit-box;
  height: 48px;
  overflow: hidden;
  color: var(--grey);
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

.post-card__more {
  align-self: flex-start;
  margin-top: auto;
  outline: none;
}

.post-card__more::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: 4px;
}

.post-card__more:focus-visible::before {
  outline: 2px solid var(--sky);
  outline-offset: 8px;
}

@media (hover: hover) {
  .post-card:hover .post-card__media img {
    transform: scale(1.06);
  }

  .post-card:hover .post-card__title {
    color: var(--blue);
  }

  .post-card:hover .post-card__more {
    color: var(--blue-600);
  }

  .post-card:hover .post-card__more::after {
    transform: translateX(3px);
  }
}

.post-card .post-card__more:active,
.post-card:has(.post-card__media:active) .post-card__more {
  color: var(--blue);
}

.blog-more {
  display: flex;
  justify-content: flex-end;
  margin-top: 64px;
}

.blog-btn {
  min-width: 145px;
}

.blog-btn:focus-visible {
  outline: 2px solid var(--sky);
  outline-offset: 3px;
}

.article-hero {
  padding-top: 247px;
  color: var(--white);
}

.article-hero__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.article-hero__heading {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
  max-width: 700px;
}

.crumbs ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.crumbs a {
  font-size: 16px;
  line-height: 24px;
  font-weight: 500;
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
  transition: background-size 0.4s var(--ease);
}

.crumbs li:first-child a {
  color: var(--surface);
}

.crumbs a:hover {
  background-size: 100% 1px;
}

.crumbs img {
  width: 16px;
  height: 16px;
}

.article-hero__title {
  font-size: 48px;
  line-height: 54px;
  font-weight: 600;
  letter-spacing: -0.5px;
}

.share {
  display: flex;
  flex: none;
  gap: 8px;
}

.share__btn {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 4px;
  border: 0;
  border-radius: 6px;
  background: var(--surface);
  transition: transform 0.4s var(--ease-spring), background-color 0.3s, box-shadow 0.3s;
}

.share__btn img {
  width: 24px;
  height: 24px;
}

.share__btn:hover {
  background: var(--white);
  box-shadow: 0 10px 22px -10px rgba(2, 22, 60, 0.7);
  transform: translateY(-2px);
}

.share__btn:active {
  transform: scale(0.92);
}

.share__btn:focus-visible {
  outline: 2px solid var(--white);
  outline-offset: 2px;
}

.article-cover {
  margin-top: 64px;
  aspect-ratio: 2 / 1;
  overflow: hidden;
  background: var(--surface-2);
}

.article-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.article-body {
  padding: 48px 0 100px;
}

.prose {
  width: min(720px, 100% - 2 * var(--gutter));
  margin-inline: auto;
}

.prose p {
  padding-bottom: 16px;
}

.prose p.is-joined {
  padding-bottom: 8px;
}

.prose h2 {
  padding: 16px 0;
  font-size: 24px;
  line-height: 32px;
  font-weight: 700;
}

.prose h3 {
  padding: 8px 0 16px;
  font-size: 16px;
  line-height: 20px;
  font-weight: 600;
}

.prose ul {
  padding-bottom: 16px;
}

.prose li {
  position: relative;
  padding-left: 24px;
}

.prose li + li {
  margin-top: 12px;
}

.prose li::before {
  content: "";
  position: absolute;
  left: 11px;
  top: 10px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
}

.related {
  padding: 100px 0;
}

.related__head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  text-align: center;
}

.related__eyebrow {
  color: var(--grey);
  font-size: 12px;
  line-height: 16px;
  font-weight: 500;
  letter-spacing: 0.48px;
}

.related__title {
  color: var(--blue);
  font-size: 48px;
  line-height: 54px;
  font-weight: 600;
  letter-spacing: -0.5px;
}

.related__title span {
  color: var(--grey);
}

.related__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 32px;
  margin-top: 48px;
}

.related__action {
  display: flex;
  justify-content: center;
  margin-top: 64px;
}

.read-progress {
  position: fixed;
  inset: 0 0 auto;
  z-index: 60;
  height: 3px;
  pointer-events: none;
  visibility: hidden;
  transition: visibility 0s linear 0.3s;
}

.read-progress.is-on {
  visibility: visible;
  transition: none;
}

body.menu-open .read-progress {
  visibility: hidden;
}

.read-progress span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--sky), var(--blue-500));
  box-shadow: 0 0 12px rgba(50, 144, 251, 0.7);
  transform: scaleX(0);
  transform-origin: 0 50%;
  opacity: 0;
  transition: opacity 0.3s;
}

.read-progress.is-on span {
  opacity: 1;
}

.blog-toast {
  position: fixed;
  left: 50%;
  bottom: 32px;
  z-index: 120;
  display: flex;
  align-items: center;
  gap: 10px;
  width: max-content;
  max-width: calc(100vw / var(--z, 1) - 48px);
  padding: 12px 18px;
  border-radius: 12px;
  background: rgba(4, 22, 58, 0.9);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  box-shadow: 0 0 0 0.5px rgba(255, 255, 255, 0.12), 0 18px 40px -16px rgba(2, 22, 60, 0.7);
  color: var(--white);
  font-size: 15px;
  line-height: 20px;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 16px) scale(0.96);
  transition: opacity 0.3s, transform 0.5s var(--ease-spring);
}

.blog-toast svg {
  flex: none;
  width: 18px;
  height: 18px;
  color: var(--sky);
}

.blog-toast.is-error svg {
  color: #ff9a8f;
}

.blog-toast.is-on {
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
}

@media (max-width: 1023px) {
  .blog-layout {
    display: block;
  }

  .blog-cats {
    position: static;
    margin-bottom: 32px;
  }

  .blog-cats__list {
    flex-direction: row;
    gap: 8px;
    margin: -4px calc(-1 * var(--gutter)) -16px;
    padding: 4px var(--gutter) 16px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-padding-inline: var(--gutter);
    scrollbar-width: none;
  }

  .blog-cats__list::-webkit-scrollbar {
    display: none;
  }

  .blog-cat {
    flex: none;
    width: auto;
    background: var(--white);
  }

  .blog-cat::before {
    background: linear-gradient(149deg, rgba(194, 240, 255, 0.34) 0%, rgba(255, 255, 255, 0) 35%, rgba(255, 255, 255, 0) 65%, rgba(194, 240, 255, 0.28) 100%), var(--blue-600);
    box-shadow: inset -1px -2px 7px rgba(171, 232, 255, 0.5), inset 0 2px 6px rgba(0, 77, 166, 0.26), 0 0 0 0.5px rgba(198, 240, 255, 0.35), 0 4px 10px rgba(0, 128, 255, 0.23);
  }

  .blog-cat.is-active {
    color: var(--white);
  }

  .blog-cat.is-active::before {
    opacity: 1;
  }

  .blog-cat:active {
    transform: scale(0.96);
  }
}

@media (max-width: 1023px) and (hover: hover) {
  .blog-cat:hover {
    background-color: var(--surface);
  }

  .blog-cat.is-active:hover {
    color: var(--white);
  }
}

@media (max-width: 767px) {
  .blog-glow__frame i:nth-child(1) {
    top: -399px;
  }

  .blog-glow__frame i:nth-child(2) {
    top: -725px;
  }

  .blog-glow__frame i:nth-child(3) {
    top: -395px;
  }

  .blog-hero,
  .article-hero {
    padding-top: 218px;
  }

  .blog-hero__title,
  .article-hero__title {
    font-size: 32px;
    line-height: 36px;
  }

  .blog-layout {
    margin-top: 32px;
    padding-bottom: 80px;
  }

  .blog-cats__title {
    font-weight: 600;
  }

  .blog-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 48px;
  }

  .post-card__media,
  .post-card--featured .post-card__media,
  .post-card--related .post-card__media {
    aspect-ratio: 342 / 176;
  }

  .post-card--featured .post-card__title {
    font-size: 24px;
    line-height: 32px;
    letter-spacing: 0;
  }

  .blog-more {
    margin-top: 48px;
  }

  .blog-more .blog-btn,
  .related__action .blog-btn {
    width: 100%;
  }

  .article-hero__head {
    flex-direction: column;
    align-items: flex-start;
  }

  .article-cover {
    margin-top: 32px;
    aspect-ratio: 342 / 176;
  }

  .page-article .blog-glow__frame i:nth-child(1) {
    top: -449px;
  }

  .page-article .blog-glow__frame i:nth-child(2) {
    top: -775px;
  }

  .page-article .blog-glow__frame i:nth-child(3) {
    top: -445px;
  }

  .article-body {
    padding: 32px 0 64px;
  }

  .prose h2 {
    font-size: 20px;
    line-height: 26px;
  }

  .related {
    margin-bottom: 64px;
    padding: 64px 0;
  }

  .related__title {
    font-size: 32px;
    line-height: 36px;
  }

  .related__grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 48px;
    margin-top: 32px;
  }

  .post-card--related .post-card__tag {
    display: none;
  }

  .post-card--related .post-card__excerpt {
    display: block;
    height: 40px;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  .related__action {
    margin-top: 48px;
  }

  .related__action .blog-btn {
    padding: 0 32px;
  }

  .related__action .blog-btn:not(:hover) {
    box-shadow: inset 0 0 0 0.5px rgba(198, 240, 255, 0.5), inset -1px -2px 7px rgba(171, 232, 255, 0.5), 0 4px 10px rgba(0, 128, 255, 0.23);
  }
}

@media (prefers-reduced-motion: reduce) {
  .post-card:hover .post-card__media img {
    transform: none;
  }
}
