:root {
  --blog-purple: #100744;
  --blog-violet: #6529d8;
  --blog-lilac: #a46bff;
  --blog-ink: #17134b;
  --blog-muted: #68658c;
  --blog-border: #e7e2fb;
  --blog-surface: #ffffff;
}

.blogs-page {
  background: #fafaff;
  color: var(--blog-ink);
  overflow-x: hidden;
}

.blogs-page .container {
  max-width: 1280px;
  margin: 0 auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

.blogs-hero {
  position: relative;
  isolation: isolate;
  min-height: 610px;
  background: radial-gradient(ellipse at 78% 20%, #35127c 0%, #170955 42%, #09052d 100%);
  color: #fff;
  overflow: hidden;
}

.blogs-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.2;
  background-image: radial-gradient(#fff 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: linear-gradient(110deg, transparent 20%, #000 75%);
}

.blogs-hero__inner {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(420px, 1.1fr);
  align-items: center;
  gap: 20px;
  min-height: 590px;
  padding-top: 86px;
  padding-bottom: 78px;
}

.blogs-hero__content {
  max-width: 590px;
  padding: 22px 0 8px 12px;
  animation: blog-rise 0.8s ease-out both;
}

.blogs-hero__eyebrow {
  display: inline-block;
  padding: 7px 14px;
  border-radius: 999px;
  background: rgba(105, 43, 211, 0.34);
  color: #ddd0ff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  margin-bottom: 20px;
}

.blogs-hero h1 {
  margin: 0 0 16px;
  font-size: clamp(42px, 5vw, 66px);
  line-height: 1.06;
  color: #fff;
}

.blogs-hero h1 span {
  color: var(--blog-lilac);
}

.blogs-hero__description {
  max-width: 500px;
  margin: 0 0 26px;
  color: #eeeaff;
  font-size: 17px;
  line-height: 1.7;
}

.blogs-search {
  display: flex;
  max-width: 510px;
  height: 52px;
  margin-bottom: 26px;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 12px 32px #0004;
}

.blogs-search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  padding: 0 17px;
  color: #292052;
  font-size: 14px;
}

.blogs-search input::placeholder {
  color: #9390b1;
}

.blogs-search button {
  width: 58px;
  border: 0;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #8b47f7, #5420d0);
  color: #fff;
  cursor: pointer;
  transition: filter 0.2s, transform 0.2s;
}

.blogs-search button:hover {
  filter: brightness(1.15);
  transform: scale(1.04);
}

.blogs-topics {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.blogs-topics button {
  border: 1px solid rgba(164, 107, 255, 0.16);
  border-radius: 8px;
  background: rgba(48, 20, 119, 0.58);
  color: #f2edff;
  padding: 10px 15px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.25s, transform 0.25s, box-shadow 0.25s;
}

.blogs-topics button:hover {
  background: #5e25c9;
  transform: translateY(-3px);
  box-shadow: 0 7px 16px #05001e66;
}

.blogs-topics button.is-active {
  background: linear-gradient(135deg, #7938ed, #5120c4);
  box-shadow: 0 5px 16px #5d2bd46b;
}

.blogs-hero__visual {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  animation: blog-float 1s 0.15s ease-out both;
}

.blogs-hero__visual img {
  position: relative;
  z-index: 1;
  width: min(100%, 700px);
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 24px 30px #05001899);
}

.blogs-hero__visual-glow {
  position: absolute;
  width: 70%;
  height: 70%;
  border-radius: 50%;
  background: #6e36e855;
  filter: blur(60px);
}

.blogs-hero__curve {
  position: absolute;
  z-index: 3;
  bottom: -1px;
  left: -5%;
  width: 110%;
  height: 74px;
  background: #fafaff;
  clip-path: ellipse(60% 62% at 50% 100%);
}

.blogs-hero__glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(2px);
  pointer-events: none;
}

.blogs-hero__glow--one {
  width: 380px;
  height: 380px;
  top: -220px;
  left: -100px;
  background: #4620ad55;
}

.blogs-hero__glow--two {
  width: 300px;
  height: 300px;
  right: -120px;
  bottom: -100px;
  background: #6b2fde44;
}

.latest-articles {
  padding: 42px 0 28px;
  background: linear-gradient(180deg, #fafaff 0%, #fff 58%, #fafaff 100%);
}

.latest-articles__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 30px;
  align-items: start;
}

.latest-articles__toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-bottom: 20px;
}

.latest-articles__toolbar h2,
.sidebar-panel h2,
.story-cta h2 {
  margin: 0;
  color: var(--blog-ink);
  font-size: 25px;
  line-height: 1.2;
}

.latest-articles__toolbar p {
  margin: 8px 0 0;
  color: #665f94;
  font-size: 13px;
  font-weight: 600;
}

.sort-control {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #6c64a0;
  font-size: 13px;
  font-weight: 700;
}

.sort-control select {
  min-width: 142px;
  appearance: none;
  border: 1px solid var(--blog-border);
  border-radius: 10px;
  color: var(--blog-violet);
  background: #fff url("data:image/svg+xml,%3Csvg width='14' height='14' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m6 9 6 6 6-6' fill='none' stroke='%236529d8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 12px center;
  padding: 12px 34px 12px 14px;
  font: inherit;
  box-shadow: 0 10px 22px rgba(80, 45, 148, 0.06);
}

.article-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.article-card,
.sidebar-panel {
  border: 1px solid var(--blog-border);
  border-radius: 8px;
  background: var(--blog-surface);
  box-shadow: 0 12px 30px rgba(46, 25, 117, 0.08);
}

.article-card {
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.article-card:hover {
  transform: translateY(-6px);
  border-color: #cbbaff;
  box-shadow: 0 20px 42px rgba(52, 26, 120, 0.16);
}

.article-card__image,
.featured-image {
  position: relative;
  display: block;
  overflow: hidden;
  background: #eee9ff;
}

.article-card__image {
  aspect-ratio: 1.37;
}

.article-card__image img,
.featured-image img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.article-card:hover .article-card__image img {
  transform: scale(1.045);
}

.article-badge,
.featured-image span {
  position: absolute;
  top: 12px;
  left: 12px;
  border-radius: 7px;
  background: linear-gradient(135deg, #8c4aff, #5e21d2);
  color: #fff;
  padding: 6px 9px;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}

.article-card__body {
  padding: 18px 16px 16px;
}

.article-card h3,
.featured-panel h3 {
  margin: 0 0 11px;
  color: var(--blog-ink);
  font-size: 18px;
  line-height: 1.25;
}

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

.article-card p,
.featured-panel p,
.newsletter-panel p {
  margin: 0;
  color: #40386c;
  font-size: 14px;
  line-height: 1.55;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  margin-top: 22px;
  color: #4c4380;
  font-size: 12px;
  font-weight: 700;
}

.article-meta span:first-child {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.article-meta img {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #f2edff;
}

.article-pagination {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 34px 0 36px;
}

.article-pagination a,
.article-pagination span {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid var(--blog-border);
  border-radius: 8px;
  background: #fff;
  color: var(--blog-ink);
  text-decoration: none;
  font-weight: 800;
  box-shadow: 0 8px 18px rgba(56, 31, 130, 0.06);
}

.article-pagination a.is-active {
  color: #fff;
  background: linear-gradient(135deg, #7835ee, #5520ce);
}

.story-cta {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 22px;
  border-radius: 8px;
  padding: 28px 30px;
  color: #fff;
  background: radial-gradient(circle at 14% 38%, #6f38e7 0%, #35108d 36%, #140751 100%);
  overflow: hidden;
  position: relative;
}

.story-cta::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.18;
  background-image: radial-gradient(#fff 1px, transparent 1px);
  background-size: 28px 28px;
}

.story-cta > * {
  position: relative;
  z-index: 1;
}

.story-cta__icon {
  width: 74px;
  height: 74px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(135deg, #9b66ff, #5b21c9);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18), 0 16px 34px rgba(0, 0, 0, 0.22);
}

.story-cta h2,
.story-cta p {
  color: #fff;
}

.story-cta p {
  margin: 8px 0 0;
  max-width: 560px;
  line-height: 1.6;
}

.story-cta a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 22px;
  border-radius: 8px;
  background: #fff;
  color: var(--blog-violet);
  font-weight: 800;
  text-decoration: none;
  box-shadow: 0 12px 28px rgba(4, 0, 30, 0.18);
}

.latest-articles__sidebar {
  display: grid;
  gap: 22px;
}

.sidebar-panel {
  padding: 26px 24px;
}

.sidebar-panel h2 {
  margin-bottom: 22px;
  font-size: 20px;
}

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

.topic-list li {
  display: grid;
  grid-template-columns: 42px 1fr;
  column-gap: 12px;
  align-items: center;
}

.topic-icon {
  grid-row: span 2;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--blog-violet);
  background: #efe8ff;
  font-weight: 900;
}

.topic-list strong {
  color: var(--blog-ink);
  font-size: 14px;
}

.topic-list small,
.newsletter-panel small {
  color: #726b9b;
  font-size: 12px;
  font-weight: 600;
}

.sidebar-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 24px;
  color: var(--blog-violet);
  font-weight: 800;
  text-decoration: none;
}

.featured-panel {
  background: linear-gradient(180deg, #fbf9ff 0%, #fff 100%);
}

.featured-image {
  aspect-ratio: 1.64;
  border-radius: 8px;
  margin-bottom: 18px;
}

.featured-image span {
  left: auto;
  right: 10px;
  color: #22134e;
  background: #ffc21b;
  text-transform: uppercase;
}

.featured-panel .article-meta {
  margin-top: 16px;
}

.newsletter-panel {
  position: relative;
}

.newsletter-panel::after {
  content: "";
  position: absolute;
  top: 24px;
  right: 22px;
  width: 26px;
  height: 26px;
  background: linear-gradient(135deg, #8d4cff, #5520ce);
  clip-path: polygon(0 8%, 100% 0, 70% 100%, 48% 58%, 22% 80%);
}

.newsletter-panel form {
  display: grid;
  gap: 10px;
  margin: 18px 0 14px;
}

.newsletter-panel input {
  width: 100%;
  border: 1px solid var(--blog-border);
  border-radius: 8px;
  padding: 12px 13px;
  font-size: 14px;
  outline: 0;
}

.newsletter-panel button {
  border: 0;
  border-radius: 8px;
  min-height: 44px;
  color: #fff;
  background: linear-gradient(135deg, #823cf5, #5420ce);
  font-weight: 800;
  cursor: pointer;
}

.reveal-on-scroll {
  opacity: 1;
  transform: none;
}

html.leap-js .reveal-on-scroll {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.65s ease, transform 0.65s ease;
}

html.leap-js .reveal-on-scroll.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@keyframes blog-rise {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: none; }
}

@keyframes blog-float {
  from { opacity: 0; transform: translateX(30px) scale(0.96); }
  to { opacity: 1; transform: none; }
}

@media (max-width: 1180px) {
  .latest-articles__inner {
    grid-template-columns: 1fr;
  }

  .latest-articles__sidebar {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .article-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .latest-articles__sidebar {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .blogs-hero {
    min-height: 0;
  }

  .blogs-hero__inner {
    grid-template-columns: 1fr;
    min-height: 0;
    padding-top: 55px;
    padding-bottom: 85px;
    text-align: center;
  }

  .blogs-hero__content {
    margin: 0 auto;
    padding: 14px 10px 0;
  }

  .blogs-hero__description,
  .blogs-search {
    margin-left: auto;
    margin-right: auto;
  }

  .blogs-topics {
    justify-content: center;
  }

  .blogs-hero__visual {
    order: -1;
    margin-bottom: -20px;
  }

  .blogs-hero__visual img {
    width: min(82vw, 500px);
  }

  .blogs-hero__curve {
    height: 48px;
  }

  .story-cta {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .story-cta__icon,
  .story-cta a {
    margin: 0 auto;
  }
}

@media (max-width: 640px) {
  .blogs-page .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .latest-articles {
    padding-top: 28px;
  }

  .latest-articles__toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .sort-control,
  .sort-control select {
    width: 100%;
  }

  .article-grid {
    grid-template-columns: 1fr;
  }

  .article-card__body,
  .sidebar-panel {
    padding: 18px;
  }

  .article-pagination {
    gap: 7px;
  }

  .article-pagination a,
  .article-pagination span {
    width: 34px;
    height: 34px;
  }
}

@media (max-width: 520px) {
  .blogs-hero h1 {
    font-size: 42px;
  }

  .blogs-hero__description {
    font-size: 15px;
  }

  .blogs-topics {
    gap: 7px;
  }

  .blogs-topics button {
    padding: 9px 11px;
    font-size: 11px;
  }

  .blogs-hero__visual img {
    width: 100%;
  }

  .blogs-hero__inner {
    padding-left: 18px;
    padding-right: 18px;
  }

  .story-cta {
    padding: 24px 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
