/* ============================
   Changelog Page
   Builds on home.css: container and CTA
   ============================ */

body {
  text-wrap: pretty;
}

/* ---- Hero: same type and spacing as the product page heroes ---- */
.cl-hero {
  padding-top: calc(var(--hp-nav-height) + clamp(88px, 11vw, 200px));
}
.cl-headline {
  margin: 0;
  font-size: clamp(44px, 5.4vw, 80px);
  font-weight: 500;
  line-height: 1.02;
  letter-spacing: -0.03em;
  color: var(--text-primary);
}
.cl-subhead {
  max-width: 30em;
  margin: clamp(24px, 2.4vw, 40px) 0 0;
  font-size: 20px;
  line-height: 1.5;
  letter-spacing: -0.01em;
  color: var(--hp-text-muted);
}
.cl-headline,
.cl-subhead {
  opacity: 0;
  animation: heroBlurIn 0.6s ease forwards;
}
.cl-subhead { animation-delay: 0.1s; }

/* ---- Feed: dates on a timeline at the left, entries centered on the page ---- */
.cl-feed-section {
  padding: clamp(72px, 8.5vw, 160px) 0 clamp(96px, 11vw, 180px);
}
.cl-feed {
  --cl-dot: 7px;
  --cl-sticky-top: calc(var(--hp-nav-height) + 40px);
  /* Centers the 24px date line on the first line of the title */
  --cl-date-offset: calc((clamp(30px, 2.8vw, 40px) * 1.15 - 24px) / 2);
  position: relative;
  opacity: 0;
  animation: heroFadeIn 0.8s ease 0.25s forwards;
}
.cl-feed::before {
  content: '';
  position: absolute;
  top: calc(var(--cl-date-offset) + 12px);
  bottom: 0;
  left: calc(var(--cl-dot) / 2 - 0.5px);
  width: 1px;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.1) calc(100% - 240px), transparent);
}
.cl-entry {
  display: grid;
  /* The side columns stay equal so the content column sits at the page center;
     on narrower screens the right one gives way first */
  grid-template-columns: minmax(176px, 1fr) minmax(0, 760px) minmax(0, 1fr);
  column-gap: 40px;
  padding-bottom: clamp(72px, 7.5vw, 128px);
  scroll-margin-top: var(--cl-sticky-top);
}
.cl-entry[hidden] { display: none; }
.cl-entry:last-child { padding-bottom: 0; }

.cl-date {
  position: sticky;
  top: var(--cl-sticky-top);
  align-self: start;
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 0;
  padding-top: var(--cl-date-offset);
  font-size: 16px;
  line-height: 24px;
  font-variant-numeric: tabular-nums;
  color: var(--hp-text-muted);
}
.cl-date::before {
  content: '';
  flex: none;
  width: var(--cl-dot);
  height: var(--cl-dot);
  border-radius: 50%;
  background: #3A3D3C;
  box-shadow: 0 0 0 4px var(--bg-primary);
}
/* Pulse ring, centered on the dot */
.cl-date::after {
  content: none;
  position: absolute;
  top: calc(var(--cl-date-offset) + 12px - var(--cl-dot) / 2);
  left: 0;
  width: var(--cl-dot);
  height: var(--cl-dot);
  border-radius: 50%;
  background: #77AB97;
  pointer-events: none;
}
@keyframes clPulse {
  0%        { transform: scale(1); opacity: 0.6; }
  70%, 100% { transform: scale(3.2); opacity: 0; }
}

/* The newest visible entry is lit and pulses; hidden drafts are skipped */
.cl-entry:not([hidden]) .cl-date { color: var(--text-primary); }
.cl-entry:not([hidden]) .cl-date::before { background: #77AB97; }
.cl-entry:not([hidden]) .cl-date::after {
  content: '';
  animation: clPulse 2.4s cubic-bezier(0.22, 1, 0.36, 1) infinite;
}
.cl-entry:not([hidden]) ~ .cl-entry .cl-date { color: var(--hp-text-muted); }
.cl-entry:not([hidden]) ~ .cl-entry .cl-date::before { background: #3A3D3C; }
.cl-entry:not([hidden]) ~ .cl-entry .cl-date::after { content: none; }
@media (prefers-reduced-motion: reduce) {
  .cl-date::after { animation: none !important; content: none !important; }
}

.cl-content {
  min-width: 0;
}
.cl-title {
  margin: 0;
  font-size: clamp(30px, 2.8vw, 40px);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  text-wrap: balance;
}
.cl-title a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}
.cl-title a:hover { color: #77AB97; }

/* ---- Entry body: case study type scale ---- */
.cl-body {
  margin-top: clamp(20px, 2vw, 28px);
  font-size: 20px;
}
.cl-body p,
.cl-body ul {
  margin: 0 0 1.2em;
  font-size: 1em;
  line-height: 1.6;
  letter-spacing: -0.01em;
  color: rgba(255, 255, 255, 0.72);
}
.cl-body > :last-child { margin-bottom: 0; }
.cl-body ul {
  padding-left: 1.2em;
}
.cl-body li {
  margin-bottom: 0.4em;
}
.cl-body li:last-child { margin-bottom: 0; }
.cl-body strong {
  color: var(--text-primary);
  font-weight: 500;
}
.cl-body code {
  padding: 0.1em 0.35em;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  font-family: var(--mono);
  font-size: 0.8em;
  color: rgba(255, 255, 255, 0.88);
  overflow-wrap: anywhere;
}
/* Links match the homepage: green, no underline, arrow nudges on hover */
.cl-body a {
  color: #77AB97;
  text-decoration: none;
}
.cl-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 28px;
}
.cl-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.cl-link svg {
  flex: none;
  width: 16px;
  height: 16px;
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
.cl-link:focus-visible {
  outline: 2px solid var(--text-primary);
  outline-offset: 3px;
}
@media (hover: hover) {
  .cl-link:hover svg { transform: translateX(4px); }
}

.cl-img {
  margin: 1.6em 0 0;
  background: #151917;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08);
  overflow: hidden;
}
.cl-img img {
  display: block;
  width: 100%;
  height: auto;
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .cl-hero { padding-top: calc(var(--hp-nav-height) + 56px); }
  .cl-feed::before { display: none; }
  /* Dates sit above each title instead of in a sticky column */
  .cl-entry {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 12px;
  }
  .cl-date {
    position: relative;
    top: auto;
    padding-top: 0;
    gap: 12px;
    font-size: 15px;
  }
  .cl-date::after { top: calc(12px - var(--cl-dot) / 2); }
  .cl-body { font-size: 18px; }
}
@media (max-width: 600px) {
  .cl-title { font-size: 28px; }
}
