/* changelog page */
.changelog-main {
  padding-top: calc(var(--page-header-content-gap) + 0.25rem) !important;
}

.changelog-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.55fr);
  gap: clamp(1rem, 2.5vw, 2rem);
  align-items: stretch;
  margin-bottom: 4rem;
}

.changelog-hero::before {
  content: '';
  position: absolute;
  inset: -4rem 18% auto -8%;
  height: 22rem;
  border-radius: 999px;
  background:
    radial-gradient(circle at 32% 48%, rgba(var(--ambient-green-rgb), 0.16), transparent 58%),
    radial-gradient(circle at 78% 28%, rgba(var(--ambient-cyan-rgb), 0.12), transparent 44%);
  filter: blur(56px);
  opacity: 0.72;
  pointer-events: none;
  z-index: -1;
}

.changelog-hero-copy,
.changelog-release-panel,
.changelog-card,
.detail-shell,
.changelog-empty {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(171, 255, 206, 0.12);
  background:
    linear-gradient(180deg, rgba(12, 22, 18, 0.94) 0%, rgba(4, 8, 6, 0.94) 100%);
  box-shadow: var(--shadow-soft), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.changelog-hero-copy::before,
.changelog-release-panel::before,
.changelog-card::before,
.detail-shell::before,
.changelog-empty::before {
  content: '';
  position: absolute;
  inset: 0 var(--radius-lg) auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(100, 255, 150, 0.52), rgba(111, 229, 255, 0.34), transparent);
  pointer-events: none;
}

.changelog-hero-copy {
  display: grid;
  align-content: center;
  min-height: 360px;
  padding: clamp(1.5rem, 3.4vw, 3rem);
  border-radius: var(--radius-lg);
}

.changelog-hero-copy .display-lg {
  max-width: 780px;
  margin: 0.65rem 0 1.15rem;
}

.changelog-hero-copy .section-desc {
  max-width: 66ch;
}

.changelog-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.75rem;
}

.changelog-release-panel {
  display: grid;
  align-content: start;
  gap: 1rem;
  padding: 1.4rem;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 100% 0%, rgba(111, 229, 255, 0.14), transparent 36%),
    radial-gradient(circle at 0% 100%, rgba(100, 255, 150, 0.12), transparent 42%),
    linear-gradient(180deg, rgba(13, 24, 20, 0.96) 0%, rgba(4, 8, 6, 0.96) 100%);
}

.release-panel-label {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--primary);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.release-panel-label::before {
  content: '';
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 999px;
  background: var(--primary);
  box-shadow: 0 0 14px rgba(100, 255, 150, 0.5);
}

.release-panel-version {
  margin-top: 1.1rem;
  color: var(--accent);
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(2.7rem, 6vw, 5rem);
  font-weight: 700;
  line-height: 0.9;
  letter-spacing: -0.02em;
}

.changelog-release-panel h2 {
  margin: 0;
  color: var(--text-primary);
  font-size: clamp(1.25rem, 2vw, 1.75rem);
  line-height: 1.15;
}

.changelog-release-panel p {
  margin: 0;
  color: var(--text-secondary);
}

.release-panel-stats {
  display: grid;
  gap: 0.6rem;
  margin-top: 0.85rem;
}

.release-panel-stats span {
  display: grid;
  grid-template-columns: 4rem minmax(0, 1fr);
  gap: 0.8rem;
  align-items: center;
  min-height: 58px;
  padding: 0.72rem 0.8rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(171, 255, 206, 0.1);
  background: rgba(5, 12, 9, 0.72);
}

.release-panel-stats strong {
  color: var(--text-primary);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.15rem;
}

.release-panel-stats small {
  min-width: 0;
  color: var(--text-muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.changelog-feed-section {
  margin-top: 0;
}

.changelog-feed-head {
  display: block;
  margin-bottom: var(--section-heading-content-gap);
}

.changelog-feed-head .headline-md {
  margin: var(--section-kicker-title-gap) 0 0;
}

.changelog-container {
  position: relative;
  display: grid;
  gap: 1.35rem;
  padding-left: 4.15rem;
}

.changelog-container::after {
  content: '';
  position: absolute;
  left: calc(2.23rem - 2px);
  top: 0.8rem;
  bottom: 1.8rem;
  width: 4px;
  border-radius: 99px;
  background: linear-gradient(180deg, var(--primary) 0%, var(--accent) 55%, transparent 100%);
  box-shadow: 0 0 10px rgba(100, 255, 150, 0.18);
  opacity: 0.75;
  z-index: 0;
}

.changelog-entry {
  position: relative;
  display: grid;
  gap: 0.85rem;
  z-index: 1;
}

.changelog-entry::before {
  content: '';
  position: absolute;
  left: -2.42rem;
  top: 0.42rem;
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  background: radial-gradient(circle, #f2fff7 0%, #9dffbf 34%, var(--primary) 68%, #00b455 100%);
  box-shadow:
    0 0 0 6px rgba(4, 8, 6, 0.92),
    0 0 0 9px rgba(100, 255, 150, 0.1),
    0 0 18px rgba(100, 255, 150, 0.32);
  z-index: 3;
}

.changelog-entry::after {
  content: '';
  position: absolute;
  left: -2.7rem;
  top: 0.14rem;
  width: 1.56rem;
  height: 1.56rem;
  border-radius: var(--radius-xs);
  border: 1px solid rgba(100, 255, 150, 0.24);
  background:
    linear-gradient(135deg, rgba(100, 255, 150, 0.18), rgba(111, 229, 255, 0.06)),
    rgba(5, 12, 9, 0.92);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 0 0 1px rgba(4, 8, 6, 0.92),
    0 0 22px rgba(100, 255, 150, 0.14);
  transform: rotate(45deg);
  z-index: 2;
  pointer-events: none;
}

.changelog-entry.is-latest::before {
  background: radial-gradient(circle, #ffffff 0%, #bfffd2 28%, var(--accent) 64%, var(--primary) 100%);
  box-shadow:
    0 0 0 6px rgba(4, 8, 6, 0.92),
    0 0 0 10px rgba(111, 229, 255, 0.12),
    0 0 28px rgba(111, 229, 255, 0.42);
}

.changelog-entry.is-latest::after {
  border-color: rgba(111, 229, 255, 0.42);
  background:
    linear-gradient(135deg, rgba(111, 229, 255, 0.22), rgba(100, 255, 150, 0.1)),
    rgba(5, 12, 9, 0.96);
}

.version-badge {
  position: relative;
  justify-self: start;
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.55rem;
  min-height: 34px;
  padding: 0.36rem 0.8rem;
  border-radius: var(--radius-sm);
  background: rgba(100, 255, 150, 0.1);
  border: 1px solid rgba(100, 255, 150, 0.22);
  color: var(--primary);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.version-badge::before {
  content: '';
  position: absolute;
  left: -1.5rem;
  top: 50%;
  width: 1.05rem;
  height: 2px;
  border-radius: 99px;
  background: linear-gradient(90deg, rgba(111, 229, 255, 0.54), rgba(100, 255, 150, 0.2), transparent);
  box-shadow: 0 0 12px rgba(111, 229, 255, 0.16);
  transform: translateY(-50%);
  pointer-events: none;
}

.version-date {
  color: var(--text-muted);
  font-family: 'Manrope', sans-serif;
  font-size: 0.86rem;
  letter-spacing: 0.02em;
}

.changelog-card {
  display: grid;
  gap: 1.2rem;
  padding: clamp(1.2rem, 2.4vw, 2rem);
  border-radius: var(--radius-lg);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.changelog-card:hover {
  transform: translateY(-2px);
  border-color: rgba(161, 255, 199, 0.2);
  box-shadow: var(--shadow-deep), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.changelog-entry.is-latest .changelog-card {
  background:
    radial-gradient(circle at 100% 0%, rgba(100, 255, 150, 0.14), rgba(111, 229, 255, 0.05) 36%, transparent 72%),
    linear-gradient(180deg, rgba(12, 24, 18, 0.96) 0%, rgba(4, 8, 6, 0.96) 100%);
}

.changelog-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.changelog-title {
  margin: 0;
  color: var(--text-primary);
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(1.35rem, 2.2vw, 1.9rem);
  line-height: 1.14;
}

.latest-chip {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0.25rem 0.62rem;
  border-radius: var(--radius-sm);
  color: #06170d;
  background: linear-gradient(135deg, #c6ffd8, var(--primary));
  font-size: 0.72rem;
  font-weight: 900;
}

.changelog-body {
  color: var(--text-secondary);
}

.changelog-body ul {
  display: grid;
  gap: 0.85rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.changelog-body li {
  position: relative;
  padding-left: 1.25rem;
  line-height: 1.65;
}

.changelog-body li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.7rem;
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 999px;
  background: radial-gradient(circle, #d6ffe4 0%, var(--primary) 45%, rgba(100, 255, 150, 0.1) 100%);
  box-shadow: 0 0 8px rgba(100, 255, 150, 0.5);
}

.changelog-body strong,
.changelog-body b {
  color: var(--text-primary);
}

.changelog-body code {
  display: inline-block;
  vertical-align: middle;
  line-height: 1.2;
  padding: 0.12rem 0.34rem;
  border-radius: 6px;
  color: var(--primary);
  background: rgba(100, 255, 150, 0.08);
  border: 1px solid rgba(100, 255, 150, 0.2);
  font-size: 0.88em;
}

.changelog-footer {
  display: flex;
  justify-content: flex-start;
  padding-top: 0.35rem;
}

.changelog-empty {
  padding: 2rem;
  border-radius: var(--radius-lg);
}

.changelog-empty h2,
.changelog-empty p {
  margin: 0;
}

.changelog-empty p {
  margin-top: 0.6rem;
  color: var(--text-secondary);
}



/* detail page */
.changelog-detail-main {
  width: min(100%, 960px);
  padding-top: calc(var(--page-header-content-gap) + 0.25rem) !important;
}

.detail-back {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 38px;
  margin-bottom: 0.5rem;
  color: var(--primary);
  text-decoration: none;
  font-weight: 700;
  transition: transform 0.18s ease, color 0.18s ease;
}

.detail-back:hover {
  color: var(--text-primary);
  transform: translateX(-4px);
}

.detail-shell {
  display: grid;
  gap: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border-radius: 0 !important;
  transform: none !important;
  overflow: visible !important;
}

.detail-shell::before {
  display: none !important;
}

.detail-header {
  display: grid;
  gap: 0;
  padding-bottom: 1.5rem;
  border-bottom: none;
  max-width: 860px;
  width: 100%;
  margin: 0 auto;
}

.detail-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.detail-header .version-badge::before {
  display: none;
}

@media (max-width: 480px) {
  .detail-header .version-badge {
    width: auto;
  }
}

.detail-header .display-lg {
  display: inline-block;
  justify-self: start;
  width: fit-content;
  margin: var(--section-kicker-title-gap) 0 0;
  font-size: clamp(1.8rem, 3.5vw, 2.2rem);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #cffff1 0%, var(--primary) 24%, var(--accent) 68%, #ffe085 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.detail-date {
  color: var(--text-muted);
  font-weight: 700;
}

.detail-page .article-body {
  line-height: 1.45;
}

.detail-page .article-body h1 {
  margin-bottom: 0.75rem;
}

.detail-page .article-body h1+p {
  margin-top: -0.15rem;
  margin-bottom: 0.9rem;
  line-height: 1.35;
}

.detail-page .article-body h2 {
  margin: 1.4rem 0 0.55rem;
}

.detail-page .article-body h3 {
  margin: 1rem 0 0.48rem;
}

.detail-page .article-body h4 {
  margin: 0.88rem 0 0.4rem;
}

.detail-page .article-body h5 {
  margin: 0.8rem 0 0.4rem;
}

.detail-page .article-body h6 {
  margin: 0.7rem 0 0.4rem;
}

.detail-page .article-body p,
.detail-page .article-body ul,
.detail-page .article-body ol,
.detail-page .article-body blockquote,
.detail-page .article-body pre,
.detail-page .article-body table,
.detail-page .article-body hr {
  margin-top: 0.45rem;
}

.detail-page .article-body ul,
.detail-page .article-body ol {
  gap: 0.4rem;
}

.detail-page .article-body ul > li,
.detail-page .article-body ol > li,
.detail-page .article-body blockquote p {
  line-height: 1.4;
}

.detail-page .article-body ul ul,
.detail-page .article-body ul ol,
.detail-page .article-body ol ul,
.detail-page .article-body ol ol {
  margin-top: 0.3rem;
  gap: 0.3rem;
}

.detail-page .article-body blockquote,
.detail-page .article-body pre {
  margin: 0.9rem 0;
}

.detail-page .article-body table {
  margin: 1rem 0;
}

.detail-page .article-body hr {
  margin: 1.75rem 0;
}

.detail-page .article-body img {
  margin: 0.9rem auto 0.25rem;
}

.detail-page .article-body p:has(> img) {
  margin-bottom: 0;
  line-height: 0;
}

.detail-page .article-body p:has(> img) + p {
  margin-top: 0;
}

.detail-page .article-body p>img~em {
  margin-top: 0.1rem;
  margin-bottom: 0.9rem;
}

.detail-page .article-body p>em:only-child {
  margin-top: 0.1rem;
  margin-bottom: 0.9rem;
  line-height: 1.25;
}

@media (max-width: 1024px) {
  .changelog-hero {
    grid-template-columns: 1fr;
  }

  .changelog-release-panel {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 720px) {
  .changelog-main,
  .changelog-detail-main {
    padding-top: var(--page-header-content-gap) !important;
  }

  .changelog-page .site-footer,
  .detail-page .site-footer {
    margin-top: var(--page-header-content-gap) !important;
  }

  .changelog-hero {
    margin-bottom: 3rem;
  }

  .changelog-hero-copy,
  .changelog-release-panel,
  .changelog-card,
  .detail-shell,
  .changelog-empty {
    border-radius: var(--radius-md);
  }

  .changelog-hero-copy {
    min-height: auto;
    padding: 1.25rem;
  }

  .changelog-hero-actions,
  .changelog-hero-actions .btn-premium,
  .changelog-hero-actions .btn-ghost {
    width: 100%;
  }

  .release-panel-stats span {
    grid-template-columns: 3.3rem minmax(0, 1fr);
  }

  .changelog-container {
    gap: 1rem;
    padding-left: 0;
  }

  .changelog-container::before,
  .changelog-container::after,
  .changelog-entry::before,
  .changelog-entry::after,
  .version-badge::before {
    display: none;
  }

  .changelog-card-head {
    display: grid;
  }

  .latest-chip {
    justify-self: start;
  }

  .changelog-footer .btn-ghost {
    width: 100%;
  }

  .detail-back {
    margin-bottom: 0.425rem;
  }
}

@media (max-width: 480px) {
  .changelog-main {
    padding-left: 0.75rem !important;
    padding-right: 0.75rem !important;
  }

  .changelog-feed-section {
    margin-top: 0.25rem;
  }

  .changelog-feed-head {
    margin-bottom: var(--section-heading-content-gap);
  }

  .changelog-feed-head .headline-md {
    font-size: clamp(1.45rem, 7vw, 1.75rem);
    line-height: 1.18;
  }

  .changelog-hero-copy .display-lg,
  .detail-header .display-lg {
    font-size: clamp(1.65rem, 9vw, 2.25rem);
    overflow-wrap: anywhere;
  }

  .changelog-container {
    gap: 1.15rem;
  }

  .changelog-entry {
    gap: 0.55rem;
  }

  .version-badge {
    width: fit-content;
    max-width: 100%;
    min-height: 32px;
    padding: 0.32rem 0.68rem;
    gap: 0.5rem;
    font-size: 0.8rem;
    letter-spacing: 0.06em;
  }

  .version-date {
    font-size: 0.8rem;
  }

  .changelog-card {
    gap: 0.95rem;
    padding: 1.15rem;
  }

  .changelog-card-head {
    gap: 0.65rem;
  }

  .changelog-title {
    font-size: clamp(1.25rem, 6.6vw, 1.45rem);
    line-height: 1.16;
  }

  .latest-chip {
    min-height: 26px;
    padding: 0.22rem 0.56rem;
    font-size: 0.7rem;
  }

  .changelog-body ul {
    gap: 0.68rem;
  }

  .changelog-body li {
    padding-left: 1rem;
    line-height: 1.45;
  }

  .changelog-body li::before {
    top: 0.58rem;
    width: 0.34rem;
    height: 0.34rem;
  }

  .changelog-footer {
    padding-top: 0.15rem;
  }

  .changelog-footer .btn-ghost {
    min-height: 42px;
    padding: 0.66rem 0.85rem;
    white-space: normal;
    text-align: center;
  }

  .changelog-release-panel {
    padding: 1.1rem;
  }

  .release-panel-stats {
    gap: 0.5rem;
  }
}

/* premium changelog detail pagination (styled like detail-back) */
.changelog-pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1rem;
  padding: 0.5rem 0;
}

.changelog-pagination .pagination-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 38px;
  color: var(--primary);
  text-decoration: none;
  font-weight: 700;
  transition: transform 0.18s ease, color 0.18s ease;
}

.changelog-pagination .pagination-link:hover {
  color: var(--text-primary);
}

.changelog-pagination .pagination-prev:hover {
  transform: translateX(-4px);
}

.changelog-pagination .pagination-next:hover {
  transform: translateX(4px);
}

.changelog-pagination .pagination-placeholder {
  pointer-events: none;
  visibility: hidden;
}

@media (max-width: 640px) {
  .changelog-pagination {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
  }
  
  .changelog-pagination .pagination-next {
    justify-content: flex-end;
  }
}
