/* ============================================================
   LAFFI · Linear-style "system" layer
   Changelog / timeline / badges / Markdown-article prose.
   Append after style.css/database.css on log, blog, article &
   docs pages. Reuses tokens from style.css.
   ============================================================ */

/* ---------- Linear tone ---------- */
.linear-body {
  max-width: 760px;
  margin: 0 auto;
}

/* ---------- Change badges ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.4px;
  line-height: 1.6;
  text-transform: uppercase;
  white-space: nowrap;
  border: 1px solid transparent;
}

/* type label dot */
.badge::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.badge-add    { color: #5ce08a; background: rgba(92, 224, 138, 0.10); border-color: rgba(92,224,138,.25); }
.badge-fix    { color: #ffb86b; background: rgba(255, 184, 107, 0.10); border-color: rgba(255,184,107,.25); }
.badge-change { color: #79c0ff; background: rgba(121, 192, 255, 0.10); border-color: rgba(121,192,255,.25); }
.badge-log    { color: #9f8bff; background: rgba(159, 139, 255, 0.10); border-color: rgba(159,139,255,.25); }
.badge-wowsb  { color: #8ad0f7; background: rgba(138, 208, 247, 0.10); border-color: rgba(138,208,247,.28); }
.badge-ship   { color: #56b1ff; background: rgba(86, 177, 255, 0.10); border-color: rgba(86,177,255,.30); }

/* ---------- Timeline (Linear changelog) ---------- */
.linear-timeline {
  list-style: none;
  margin: 26px 0 0;
  padding: 0;
  position: relative;
}

/* vertical spine */
.linear-timeline::before {
  content: "";
  position: absolute;
  left: 96px;
  top: 6px;
  bottom: 6px;
  width: 1px;
  background: linear-gradient(180deg, transparent, var(--border-strong) 8%, var(--border-strong) 92%, transparent);
}

.change {
  position: relative;
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 20px;
  padding: 0 0 30px;
}

/* date + meta in the left rail */
.change-meta {
  text-align: right;
  padding-right: 0;
}

.change-date {
  font-size: 12px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  line-height: 1.4;
}

/* node on the spine */
.change-meta::after {
  content: "";
  position: absolute;
  left: 90px;          /* spine centre (96 - 1.5) */
  top: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent);
  box-shadow: 0 0 0 4px rgba(46, 160, 67, 0.18);
}

.change-card {
  background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.008));
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 18px 20px;
  transition: border-color .18s var(--ease), transform .18s var(--ease), box-shadow .18s var(--ease);
}

.change-card:hover {
  border-color: #c9d1d9;      /* less-bright neutral white edge (was green) */
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.change-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.2px;
}

.change-card p { margin: 6px 0 0; font-size: 14px; }
.change-card ul { margin: 10px 0 0; }

/* ---------- Markdown-style article prose ---------- */
.md-article {
  font-size: 16px;
  line-height: 1.75;
  color: var(--text-dim);
  max-width: 720px;
}

.md-article h1, .md-article h2, .md-article h3 {
  color: var(--text);
  line-height: 1.3;
  letter-spacing: -0.3px;
}
.md-article h2 { font-size: 24px; margin: 34px 0 10px; }
.md-article h3 { font-size: 20px; margin: 26px 0 8px; }

.md-article p { margin: 0 0 16px; }
.md-article ul, .md-article ol { margin: 0 0 18px; }
.md-article li { margin-bottom: 6px; }

.md-article a { color: #79c0ff; }
.md-article a:hover { text-decoration: underline; }

.md-article code {
  font-family: 'Cascadia Code', 'Fira Code', ui-monospace, 'SF Mono', Consolas, monospace;
  font-size: 0.86em;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  padding: 1px 5px;
  border-radius: 4px;
}

.md-article pre {
  background: #0b0c10;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 14px 16px;
  overflow-x: auto;
  color: var(--text-dim);
  margin: 0 0 18px;
}

.md-article blockquote {
  margin: 0 0 16px;
  padding: 2px 0 2px 14px;
  border-left: 3px solid var(--accent);
  color: var(--text-muted);
}

/* article header (Linear-style: badge row on top, big title, meta) */
.article-head {
  margin-bottom: 26px;
}
.article-head .title-row { display: flex; align-items: center; gap: 10px; }
.article-head h1 { margin: 8px 0 6px; letter-spacing: -0.5px; }
.article-head .meta { color: var(--text-muted); font-size: 13px; }

/* reading divider dots like Linear md docs */
.hr-dots {
  text-align: center;
  color: var(--text-muted);
  letter-spacing: 6px;
  margin: 8px 0 20px;
  -webkit-user-select: none; user-select: none;
}

/* back link */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  margin-bottom: 8px;
  transition: color .15s var(--ease);
}
.back-link:hover { color: var(--text); }

/* narrow-gap timeline rail on phones */
@media (max-width: 640px) {
  .linear-timeline::before { left: 10px; }
  .change { grid-template-columns: 1fr; gap: 6px; padding-left: 26px; }
  .change-meta { text-align: left; }
  .change-meta::after { left: 4px; }
}
