:root {
  --accent: #0078e8;
  --accent-soft: #e6f2fe;

  --bg: #f7f7fb;
  --surface: #ffffff;
  --surface-2: #f1f2f8;
  --border: #e4e4ee;
  --text: #17171f;
  --text-muted: #61616f;
  --text-faint: #8f8fa0;

  --feature: #5b5bf0;
  --feature-bg: #eef0ff;
  --improvement: #0e9f6e;
  --improvement-bg: #e6f8f1;
  --fix: #d97706;
  --fix-bg: #fef3e2;
  --security: #dc2626;
  --security-bg: #fdecec;
  --breaking: #9333ea;
  --breaking-bg: #f5eafe;

  --shadow: 0 1px 2px rgba(20, 20, 40, 0.04), 0 6px 20px rgba(20, 20, 40, 0.05);
  --radius: 14px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f0f14;
    --surface: #17171f;
    --surface-2: #1d1d27;
    --border: #2b2b38;
    --text: #f1f1f6;
    --text-muted: #a4a4b4;
    --text-faint: #6f6f80;

    --feature-bg: rgba(91, 91, 240, 0.16);
    --improvement-bg: rgba(14, 159, 110, 0.16);
    --fix-bg: rgba(217, 119, 6, 0.16);
    --security-bg: rgba(220, 38, 38, 0.18);
    --breaking-bg: rgba(147, 51, 234, 0.18);

    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.35);
  }
}

:root[data-theme="dark"] {
  --bg: #0f0f14;
  --surface: #17171f;
  --surface-2: #1d1d27;
  --border: #2b2b38;
  --text: #f1f1f6;
  --text-muted: #a4a4b4;
  --text-faint: #6f6f80;

  --feature-bg: rgba(91, 91, 240, 0.16);
  --improvement-bg: rgba(14, 159, 110, 0.16);
  --fix-bg: rgba(217, 119, 6, 0.16);
  --security-bg: rgba(220, 38, 38, 0.18);
  --breaking-bg: rgba(147, 51, 234, 0.18);

  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.35);
}

:root[data-theme="light"] {
  --bg: #f7f7fb;
  --surface: #ffffff;
  --surface-2: #f1f2f8;
  --border: #e4e4ee;
  --text: #17171f;
  --text-muted: #61616f;
  --text-faint: #8f8fa0;

  --feature-bg: #eef0ff;
  --improvement-bg: #e6f8f1;
  --fix-bg: #fef3e2;
  --security-bg: #fdecec;
  --breaking-bg: #f5eafe;

  --shadow: 0 1px 2px rgba(20, 20, 40, 0.04), 0 6px 20px rgba(20, 20, 40, 0.05);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  transition: background 0.2s ease, color 0.2s ease;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: 840px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo {
  height: 28px;
  width: auto;
  display: block;
}

/* The logo's wordmark is dark navy on a transparent background, so it
   needs a light backing plate whenever the page background goes dark. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .brand-logo {
    background: #fff;
    padding: 5px 8px;
    border-radius: 8px;
  }
}
:root[data-theme="dark"] .brand-logo {
  background: #fff;
  padding: 5px 8px;
  border-radius: 8px;
}

.brand-sub {
  font-size: 12px;
  color: var(--text-muted);
  padding-left: 12px;
  border-left: 1px solid var(--border);
}

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  display: grid;
  place-items: center;
  cursor: pointer;
}

.icon-btn:hover {
  color: var(--text);
  border-color: var(--accent);
}

.icon {
  width: 17px;
  height: 17px;
}

.icon-moon { display: none; }
:root[data-theme="dark"] .icon-sun { display: none; }
:root[data-theme="dark"] .icon-moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .icon-sun { display: none; }
  :root:not([data-theme="light"]) .icon-moon { display: block; }
}

/* Page */
.page {
  max-width: 840px;
  margin: 0 auto;
  padding: 0 24px 80px;
}

.hero {
  padding: 56px 0 28px;
  text-align: center;
}

.hero h1 {
  font-size: clamp(28px, 4vw, 38px);
  margin: 0 0 10px;
  letter-spacing: -0.01em;
}

.hero-sub {
  color: var(--text-muted);
  font-size: 16px;
  margin: 0 0 32px;
}

.stat-row {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 0;
  flex-wrap: wrap;
}

.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 22px;
  min-width: 140px;
  box-shadow: var(--shadow);
}

.stat dt {
  font-size: 12px;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.stat dd {
  margin: 0;
  font-size: 19px;
  font-weight: 700;
}

/* Controls */
.controls {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 36px;
}

.search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.search-wrap .icon {
  position: absolute;
  left: 14px;
  color: var(--text-faint);
  pointer-events: none;
}

#search {
  width: 100%;
  padding: 11px 14px 11px 40px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  outline: none;
}

#search:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.chip-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.chip {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

.chip:hover {
  border-color: var(--accent);
  color: var(--text);
}

.chip.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* Timeline */
.timeline {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: var(--border);
}

.release-card {
  position: relative;
  display: flex;
  gap: 22px;
  padding-left: 30px;
}

.release-marker {
  position: absolute;
  left: 0;
  top: 8px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.release-body {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--shadow);
}

.release-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.release-version {
  margin: 0;
  font-size: 19px;
  letter-spacing: -0.01em;
}

.release-date {
  font-size: 13px;
  color: var(--text-faint);
  white-space: nowrap;
}

.release-title {
  margin: 4px 0 16px;
  color: var(--text-muted);
  font-size: 14.5px;
}

.change-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.change-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14.5px;
  line-height: 1.5;
}

.change-text {
  padding-top: 2px;
}

.badge {
  flex-shrink: 0;
  font-size: 11.5px;
  font-weight: 600;
  padding: 2.5px 9px;
  border-radius: 999px;
  white-space: nowrap;
  margin-top: 1px;
}

.badge-feature { color: var(--feature); background: var(--feature-bg); }
.badge-improvement { color: var(--improvement); background: var(--improvement-bg); }
.badge-fix { color: var(--fix); background: var(--fix-bg); }
.badge-security { color: var(--security); background: var(--security-bg); }
.badge-breaking { color: var(--breaking); background: var(--breaking-bg); }

.empty-state {
  text-align: center;
  color: var(--text-muted);
  padding: 60px 0;
}

.view-more-wrap {
  display: flex;
  justify-content: center;
  margin-top: 30px;
}

.btn-view-more {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  padding: 10px 22px;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: var(--shadow);
}

.btn-view-more:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Footer */
.site-footer {
  text-align: center;
  padding: 28px 24px 40px;
  color: var(--text-faint);
  font-size: 13px;
  border-top: 1px solid var(--border);
}

@media (max-width: 520px) {
  .release-card { padding-left: 24px; gap: 14px; }
  .stat { min-width: 100px; padding: 12px 16px; }
}
