/* ---------------------------------------------------------------------------
   Plank — Changelog
   A calm, restrained changelog in the Linear / Stripe / Clerk lineage.
   No build step; system-friendly with a single display serif for warmth.
--------------------------------------------------------------------------- */

:root {
  --bg: #fbfaf8;
  --surface: #ffffff;
  --surface-2: #f4f2ee;
  --ink: #1d1c1a;
  --ink-2: #45423d;
  --muted: #79756e;
  --line: #e8e4dd;
  --line-strong: #d8d2c8;
  --accent: #1f6f5c;
  --accent-ink: #145043;
  --accent-soft: #e6f1ec;

  --new-bg: #e4f3ea;     --new-ink: #1d6b46;     --new-dot: #2f9e6a;
  --improved-bg: #e7edfb; --improved-ink: #2f50bd; --improved-dot: #4a73e8;
  --fixed-bg: #f6ecd9;   --fixed-ink: #8a6012;   --fixed-dot: #cf9a2e;

  --shadow: 0 1px 2px rgba(28, 25, 20, .04), 0 8px 24px -16px rgba(28, 25, 20, .18);
  --radius: 14px;
  --radius-sm: 9px;

  --serif: "Newsreader", Georgia, "Iowan Old Style", "Times New Roman", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", "Fira Code", Menlo, Consolas, monospace;

  --maxw: 760px;
}

[data-theme="dark"] {
  --bg: #14130f;
  --surface: #1c1b17;
  --surface-2: #232118;
  --ink: #efece4;
  --ink-2: #cdc8bd;
  --muted: #948f84;
  --line: #2c2a23;
  --line-strong: #3a3730;
  --accent: #5cc7a6;
  --accent-ink: #8ad8bf;
  --accent-soft: #1c2c27;

  --new-bg: #16291f;     --new-ink: #74d09e;     --new-dot: #3fb87c;
  --improved-bg: #1a2236; --improved-ink: #8fa9f0; --improved-dot: #6e8fef;
  --fixed-bg: #2e2614;   --fixed-ink: #e3bd6b;   --fixed-dot: #d6a23f;

  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px -18px rgba(0, 0, 0, .7);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; }

:focus-visible {
  outline: 2.5px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 22px; }

.skip-link {
  position: absolute; left: -999px; top: 8px;
  background: var(--surface); color: var(--ink);
  padding: 10px 16px; border-radius: 8px; z-index: 50;
  border: 1px solid var(--line-strong); box-shadow: var(--shadow);
}
.skip-link:focus { left: 16px; }

/* ---- Top bar ---------------------------------------------------------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar .wrap {
  display: flex; align-items: center; justify-content: space-between;
  height: 58px; gap: 14px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand .mark {
  width: 28px; height: 28px; border-radius: 7px;
  background: linear-gradient(150deg, var(--accent), var(--accent-ink));
  display: grid; place-items: center; color: #fff; flex: none;
}
.brand .mark svg { width: 16px; height: 16px; }
.brand .name { font-size: 16px; letter-spacing: -.01em; }
.brand .sep { color: var(--line-strong); font-weight: 400; }
.brand .label { color: var(--muted); font-weight: 500; }

.topbar-actions { display: flex; align-items: center; gap: 6px; }
.iconbtn {
  width: 38px; height: 38px; display: grid; place-items: center;
  border: 1px solid transparent; border-radius: 9px;
  background: transparent; color: var(--ink-2); cursor: pointer;
}
.iconbtn:hover { background: var(--surface-2); color: var(--ink); }
.iconbtn svg { width: 18px; height: 18px; }
.iconbtn .moon { display: none; }
[data-theme="dark"] .iconbtn .moon { display: block; }
[data-theme="dark"] .iconbtn .sun { display: none; }

.ghost-link {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 13px; border-radius: 9px; font-size: 14px; font-weight: 500;
  color: var(--ink-2); border: 1px solid var(--line-strong); background: var(--surface);
}
.ghost-link:hover { text-decoration: none; border-color: var(--muted); color: var(--ink); }
.ghost-link svg { width: 15px; height: 15px; color: var(--muted); }

/* ---- Hero ------------------------------------------------------------- */
.hero { padding: 60px 0 30px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  color: var(--accent-ink);
}
.eyebrow .pulse {
  width: 7px; height: 7px; border-radius: 50%; background: var(--new-dot);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--new-dot) 60%, transparent);
  animation: pulse 2.4s ease-out infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--new-dot) 55%, transparent); }
  70% { box-shadow: 0 0 0 9px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}
.hero h1 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2.3rem, 6vw, 3.3rem);
  line-height: 1.05; letter-spacing: -.02em;
  margin: 16px 0 12px;
}
.hero p.lede {
  font-size: clamp(1.05rem, 2.4vw, 1.22rem);
  color: var(--ink-2); max-width: 56ch; margin: 0 0 26px;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 18px; border-radius: 10px; font-size: 14.5px; font-weight: 600;
  cursor: pointer; border: 1px solid transparent; line-height: 1;
}
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--accent); color: #fff; box-shadow: var(--shadow); }
.btn-primary:hover { background: var(--accent-ink); text-decoration: none; }
.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.btn-secondary:hover { border-color: var(--muted); text-decoration: none; }

/* ---- Filter bar ------------------------------------------------------- */
.controls {
  position: sticky; top: 58px; z-index: 20;
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(8px);
  padding: 14px 0; margin-top: 14px;
  border-bottom: 1px solid var(--line);
}
.controls .wrap { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.filters { display: flex; gap: 6px; flex-wrap: wrap; }
.filter {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 13px; border-radius: 999px; cursor: pointer;
  font-size: 13.5px; font-weight: 600; color: var(--ink-2);
  background: var(--surface); border: 1px solid var(--line-strong);
}
.filter:hover { border-color: var(--muted); }
.filter .dot { width: 8px; height: 8px; border-radius: 50%; }
.filter[data-filter="new"] .dot { background: var(--new-dot); }
.filter[data-filter="improved"] .dot { background: var(--improved-dot); }
.filter[data-filter="fixed"] .dot { background: var(--fixed-dot); }
.filter[data-filter="all"] .dot { background: var(--muted); }
.filter[aria-pressed="true"] {
  background: var(--ink); color: var(--bg); border-color: var(--ink);
}
.filter[aria-pressed="true"] .dot { outline: 1.5px solid color-mix(in srgb, var(--bg) 60%, transparent); }
.result-count { font-size: 13px; color: var(--muted); white-space: nowrap; }

/* ---- Timeline --------------------------------------------------------- */
main { padding: 26px 0 40px; }
.timeline { position: relative; }

.release {
  position: relative;
  display: grid;
  grid-template-columns: 132px 1fr;
  gap: 28px;
  padding: 26px 0 30px;
  border-bottom: 1px solid var(--line);
  scroll-margin-top: 130px;
}
.release.is-hidden { display: none; }
.release:target .card { box-shadow: 0 0 0 2px var(--accent), var(--shadow); }

.release-meta { padding-top: 4px; }
.release-meta time {
  display: block; font-size: 13.5px; font-weight: 600; color: var(--ink-2);
}
.release-meta .ago { display: block; font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.release-meta .version {
  display: inline-block; margin-top: 12px;
  font-family: var(--mono); font-size: 12px; color: var(--muted);
  background: var(--surface-2); border: 1px solid var(--line);
  padding: 3px 8px; border-radius: 7px;
}

.card { min-width: 0; }
.card-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 700; letter-spacing: .01em;
  padding: 4px 10px; border-radius: 7px; text-transform: uppercase;
}
.badge .dot { width: 6px; height: 6px; border-radius: 50%; }
.badge.new { background: var(--new-bg); color: var(--new-ink); }
.badge.new .dot { background: var(--new-dot); }
.badge.improved { background: var(--improved-bg); color: var(--improved-ink); }
.badge.improved .dot { background: var(--improved-dot); }
.badge.fixed { background: var(--fixed-bg); color: var(--fixed-ink); }
.badge.fixed .dot { background: var(--fixed-dot); }

.permalink {
  margin-left: auto; opacity: 0; color: var(--muted);
  display: inline-grid; place-items: center; width: 30px; height: 30px;
  border-radius: 7px; transition: opacity .15s ease;
}
.release:hover .permalink, .permalink:focus-visible { opacity: 1; }
.permalink:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }
.permalink svg { width: 15px; height: 15px; }

.card h2 {
  font-family: var(--serif); font-weight: 500;
  font-size: 1.5rem; line-height: 1.2; letter-spacing: -.015em;
  margin: 14px 0 8px;
}
.card .body { color: var(--ink-2); }
.card .body p { margin: 0 0 12px; }
.card .body ul { margin: 0 0 12px; padding-left: 20px; }
.card .body li { margin: 4px 0; }
.card .body code {
  font-family: var(--mono); font-size: .86em;
  background: var(--surface-2); border: 1px solid var(--line);
  padding: 1px 6px; border-radius: 6px; color: var(--ink);
}
.card .body strong { color: var(--ink); font-weight: 650; }

.shot {
  margin: 18px 0 4px; border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--line); background: var(--surface);
  box-shadow: var(--shadow);
}
.shot svg, .shot img { display: block; width: 100%; height: auto; }
figure.shot { margin: 18px 0 4px; }
figure.shot figcaption {
  font-size: 12.5px; color: var(--muted); padding: 9px 14px;
  border-top: 1px solid var(--line); background: var(--surface-2);
}

.contributors { display: flex; align-items: center; gap: 8px; margin-top: 16px; font-size: 13px; color: var(--muted); }
.avatars { display: flex; }
.avatars img {
  width: 24px; height: 24px; border-radius: 50%; object-fit: cover;
  border: 2px solid var(--bg); margin-left: -7px;
}
.avatars img:first-child { margin-left: 0; }

/* ---- Empty state ------------------------------------------------------ */
.empty {
  display: none; text-align: center; padding: 70px 20px; color: var(--muted);
}
.empty.show { display: block; }
.empty svg { width: 34px; height: 34px; color: var(--line-strong); margin-bottom: 10px; }

/* ---- Subscribe footer block ------------------------------------------ */
.subscribe {
  margin: 12px 0 0; padding: 38px 0;
  border-top: 1px solid var(--line);
}
.subscribe-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 30px; box-shadow: var(--shadow);
}
.subscribe-card h2 {
  font-family: var(--serif); font-weight: 500; font-size: 1.55rem;
  margin: 0 0 8px; letter-spacing: -.01em;
}
.subscribe-card p { color: var(--ink-2); margin: 0 0 20px; max-width: 50ch; }
.sub-form { display: flex; gap: 10px; flex-wrap: wrap; }
.sub-form label { position: absolute; left: -9999px; }
.sub-form input[type="email"] {
  flex: 1 1 240px; min-width: 0;
  padding: 12px 14px; font-size: 15px; font-family: var(--sans);
  border: 1px solid var(--line-strong); border-radius: 10px;
  background: var(--bg); color: var(--ink);
}
.sub-form input[type="email"]:focus-visible { border-color: var(--accent); }
.sub-note { font-size: 12.5px; color: var(--muted); margin: 12px 0 0; }
.sub-note a { color: var(--accent-ink); }

.sub-success {
  display: none; align-items: center; gap: 12px;
  background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--line));
  border-radius: 12px; padding: 16px 18px; color: var(--accent-ink); font-weight: 500;
}
.sub-success.show { display: flex; }
.sub-success svg { width: 22px; height: 22px; flex: none; }

/* ---- Footer ----------------------------------------------------------- */
footer.site {
  border-top: 1px solid var(--line); padding: 30px 0 60px;
  color: var(--muted); font-size: 13.5px;
}
footer.site .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
footer.site nav { display: flex; gap: 18px; flex-wrap: wrap; }
footer.site a { color: var(--ink-2); }
footer.site .rss { display: inline-flex; align-items: center; gap: 6px; }
footer.site .rss svg { width: 14px; height: 14px; color: var(--fixed-dot); }

/* ---- Toast ------------------------------------------------------------ */
.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: var(--bg);
  padding: 10px 16px; border-radius: 10px; font-size: 13.5px; font-weight: 500;
  box-shadow: var(--shadow); opacity: 0; pointer-events: none;
  transition: opacity .2s ease, transform .2s ease; z-index: 60;
  display: inline-flex; align-items: center; gap: 8px;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast svg { width: 15px; height: 15px; }

/* ---- Responsive ------------------------------------------------------- */
@media (max-width: 640px) {
  .release {
    grid-template-columns: 1fr; gap: 10px; padding: 22px 0 26px;
  }
  .release-meta { display: flex; align-items: baseline; gap: 10px; padding-top: 0; }
  .release-meta time { font-size: 13px; }
  .release-meta .ago { display: none; }
  .release-meta .version { margin-top: 0; margin-left: auto; }
  .hero { padding: 40px 0 18px; }
  .brand .label { display: none; }
  .ghost-link span { display: none; }
  .ghost-link { padding: 8px; }
  .subscribe-card { padding: 22px; }
  .controls { top: 57px; }
  .result-count { display: none; }
}
