/*
 * changelog.css — Styles for /changelog/index.html
 * Extends marketing.css with the timeline layout and change-entry components.
 * Design: "The Engineer's Logbook" — dark navy editorial utility.
 *
 * SINGLE-FILE BUILD EXCLUSION:
 * This file is NOT referenced by app/index.html and is therefore NOT included
 * in the single-file bundle produced by build/build.mjs. It is a marketing-only
 * stylesheet served by the static host.
 */

/* ─── Hero ────────────────────────────────────────────────────────────────── */
.cl-hero {
  background: var(--navy);
  color: #eef4ff;
  padding: 52px 0 48px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.cl-hero .section-kicker {
  color: var(--blue);
  margin-bottom: 14px;
}

.cl-hero h1 {
  font-size: clamp(36px, 5vw, 56px);
  font-weight: 900;
  line-height: 1.0;
  letter-spacing: -0.01em;
  margin: 0 0 16px;
  color: #eef4ff;
}

.cl-hero h1 span {
  color: var(--blue);
}

.cl-hero-lede {
  font-size: 1rem;
  color: #9eacbe;
  max-width: 560px;
  line-height: 1.6;
  margin: 0 0 32px;
}

.cl-stats {
  display: flex;
  gap: 36px;
  flex-wrap: wrap;
}

.cl-stat strong {
  display: block;
  font-size: 1.75rem;
  font-weight: 900;
  color: #eef4ff;
  line-height: 1.1;
  letter-spacing: -0.01em;
}

.cl-stat span {
  display: block;
  font-size: 0.75rem;
  color: #5a6a80;
  margin-top: 3px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
}

/* ─── Timeline section layout ─────────────────────────────────────────────── */
.cl-timeline-section {
  background: var(--navy);
  padding: 48px 0 80px;
  min-height: 60vh;
}

.cl-shell {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 48px;
  align-items: start;
}

@media (max-width: 760px) {
  .cl-shell {
    grid-template-columns: 1fr;
    gap: 0;
  }
}

/* ─── Version nav (sidebar) ───────────────────────────────────────────────── */
.cl-version-nav {
  position: sticky;
  top: 72px;
  padding-top: 4px;
}

.cl-version-nav-label {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #3a4a60;
  margin: 0 0 10px;
}

.cl-version-link {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #5a6a80;
  padding: 5px 0;
  text-decoration: none;
  border-left: 2px solid transparent;
  padding-left: 10px;
  margin-left: -10px;
  transition: color 0.15s ease, border-color 0.15s ease;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

.cl-version-link:hover,
.cl-version-link--latest {
  color: var(--blue);
  border-left-color: var(--blue);
}

.cl-latest-chip {
  font-size: 0.6rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: rgba(24, 178, 107, 0.18);
  color: var(--green);
  padding: 1px 5px;
  border-radius: 3px;
  font-family: inherit;
}

@media (max-width: 760px) {
  .cl-version-nav {
    display: none;
  }
}

/* ─── Timeline ────────────────────────────────────────────────────────────── */
.cl-timeline {
  position: relative;
  padding-left: 28px;
}

.cl-timeline::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 1px;
  background: linear-gradient(
    to bottom,
    transparent,
    rgba(255, 255, 255, 0.1) 8%,
    rgba(255, 255, 255, 0.1) 92%,
    transparent
  );
}

/* ─── Entry ───────────────────────────────────────────────────────────────── */
.cl-entry {
  position: relative;
  margin-bottom: 52px;
  scroll-margin-top: 80px;
}

.cl-entry:last-of-type {
  margin-bottom: 24px;
}

/* Timeline dot */
.cl-entry-dot {
  position: absolute;
  left: -33px;
  top: 10px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--blue);
  border: 2px solid var(--navy);
  box-shadow: 0 0 0 3px rgba(78, 140, 255, 0.2);
  transition: box-shadow 0.2s ease;
}

.cl-entry-dot--latest {
  animation: dot-pulse 2.4s ease-in-out infinite;
}

@keyframes dot-pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(78, 140, 255, 0.2); }
  50%       { box-shadow: 0 0 0 7px rgba(78, 140, 255, 0.06); }
}

/* Target highlight */
.cl-entry:target .cl-entry-card,
.cl-entry:target .cl-entry-header {
  border-color: rgba(78, 140, 255, 0.4);
  box-shadow: 0 0 0 1px rgba(78, 140, 255, 0.25), 0 4px 24px rgba(78, 140, 255, 0.08);
}

/* ─── Entry header ────────────────────────────────────────────────────────── */
.cl-entry-header {
  margin-bottom: 12px;
}

.cl-entry-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 10px;
}

.cl-version {
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--blue);
  margin: 0;
  letter-spacing: -0.01em;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  line-height: 1.1;
}

.cl-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: rgba(78, 140, 255, 0.12);
  color: var(--blue);
  border: 1px solid rgba(78, 140, 255, 0.22);
  padding: 3px 8px;
  border-radius: 4px;
}

.cl-latest-badge {
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: rgba(24, 178, 107, 0.15);
  color: var(--green);
  border: 1px solid rgba(24, 178, 107, 0.25);
  padding: 3px 8px;
  border-radius: 4px;
}

.cl-date {
  font-size: 0.78rem;
  color: #3a4a60;
  margin-left: auto;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  white-space: nowrap;
}

.cl-summary {
  font-size: 0.9rem;
  color: #9eacbe;
  line-height: 1.6;
  margin: 0;
}

.cl-summary code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.82em;
  background: rgba(168, 196, 255, 0.1);
  color: #a8c4ff;
  border: 1px solid rgba(168, 196, 255, 0.15);
  border-radius: 3px;
  padding: 0.1em 0.4em;
}

/* ─── Changes list ────────────────────────────────────────────────────────── */
.cl-changes {
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 10px;
  background: #111d31;
  overflow: hidden;
}

.cl-change {
  display: flex;
  gap: 14px;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  align-items: flex-start;
}

.cl-change:last-child {
  border-bottom: none;
}

/* ─── Tag pills ───────────────────────────────────────────────────────────── */
.cl-tag {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 3px 8px;
  border-radius: 4px;
  margin-top: 2px;
  white-space: nowrap;
}

.cl-tag--feature  { background: rgba(78, 140, 255, 0.15);  color: var(--blue);  }
.cl-tag--fix      { background: rgba(24, 178, 107, 0.15);  color: var(--green); }
.cl-tag--security { background: rgba(245, 158, 11, 0.15);  color: #f59e0b;      }
.cl-tag--breaking { background: rgba(239, 68, 68, 0.15);   color: #ef4444;      }
.cl-tag--removed  { background: rgba(255, 255, 255, 0.07); color: #5a6a80;      }

/* ─── Change body ─────────────────────────────────────────────────────────── */
.cl-change-body {
  flex: 1;
  min-width: 0;
}

.cl-change-body p {
  font-size: 0.85rem;
  color: #9eacbe;
  line-height: 1.6;
  margin: 0 0 8px;
}

.cl-change-body p:last-child {
  margin-bottom: 0;
}

.cl-change-body code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.8em;
  background: rgba(168, 196, 255, 0.1);
  color: #a8c4ff;
  border: 1px solid rgba(168, 196, 255, 0.15);
  border-radius: 3px;
  padding: 0.1em 0.4em;
}

.cl-files {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.cl-files code {
  font-size: 0.72rem;
}

/* ─── Timeline end marker ─────────────────────────────────────────────────── */
.cl-timeline-end {
  padding: 16px 0 0;
  font-size: 0.75rem;
  color: #2a3a50;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  display: flex;
  align-items: center;
  gap: 10px;
}

.cl-timeline-end::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #2a3a50;
  flex-shrink: 0;
}

/* ─── Scroll entrance animation ───────────────────────────────────────────── */
@media (prefers-reduced-motion: no-preference) {
  .cl-entry {
    opacity: 0;
    transform: translateX(-10px);
    transition: opacity 0.38s cubic-bezier(0.23, 1, 0.32, 1),
                transform 0.38s cubic-bezier(0.23, 1, 0.32, 1);
  }
  .cl-entry.cl-in-view {
    opacity: 1;
    transform: translateX(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .cl-entry { opacity: 1; transform: none; }
}

/* ─── Inline scroll animation script ─────────────────────────────────────── */
/* (Applied via <script> in the page — no JS framework dependency) */

/* ─── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .cl-hero {
    padding: 36px 0 32px;
  }
  .cl-hero h1 {
    font-size: 2rem;
  }
  .cl-stats {
    gap: 24px;
  }
  .cl-timeline {
    padding-left: 20px;
  }
  .cl-entry-dot {
    left: -25px;
  }
  .cl-change {
    flex-direction: column;
    gap: 8px;
    padding: 12px 14px;
  }
  .cl-date {
    margin-left: 0;
  }
  .cl-entry-meta {
    flex-direction: column;
    gap: 6px;
  }
}
