:root {
  --bg: #f7f7f7;
  --surface: #ffffff;
  --ink: #1f2328;
  --muted: #5f6872;
  --brand: #1d1f22;
  --brand-link: #f5f7fa;
  --line: #dfe4ea;
  --accent: #0b63ce;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: #004d9b;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.container {
  width: min(1040px, calc(100% - 2rem));
  margin: 0 auto;
}

.topbar {
  position: fixed;
  inset: 0 0 auto 0;
  background: linear-gradient(180deg, #1a1f27 0%, #121720 45%, #0b1018 100%);
  border-bottom: 1px solid #060a11;
  box-shadow: 0 2px 8px rgba(4, 7, 12, 0.35);
  z-index: 20;
}

.topbar-inner {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--brand-link);
  text-decoration: none;
  font-size: 1.25rem;
  font-weight: 700;
}

.brand img {
  height: 30px;
  width: auto;
}

nav {
  display: flex;
  gap: 0.35rem;
}

nav a {
  color: var(--brand-link);
  padding: 0.55rem 0.8rem;
  border-radius: 6px;
  font-weight: 700;
}

nav a:hover,
nav a.active {
  text-decoration: none;
  background: rgba(255, 255, 255, 0.14);
}

.page {
  flex: 1 0 auto;
  margin-top: 84px;
  margin-bottom: 44px;
}

section {
  margin: 0 0 1.25rem;
}

.hero-block {
  background: linear-gradient(135deg, #f4f8fd 0%, #ffffff 65%);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1.2rem;
}

.hero-subtitle {
  margin: 0.75rem 0 0;
  color: var(--muted);
  font-size: 1.02rem;
}

h1,
h2,
h3 {
  color: #121417;
  margin-top: 0;
}

h1 {
  font-size: clamp(1.45rem, 2.8vw, 2.25rem);
  margin-bottom: 0;
}

h2 {
  font-size: 1.45rem;
  margin-bottom: 0.6rem;
}

h3 {
  font-size: 1.15rem;
  margin-bottom: 0.45rem;
}

p,
li {
  line-height: 1.55;
  color: #222;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1rem;
}

.video-grid {
  display: grid;
  gap: 0.9rem;
}

.video-item {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #111;
}

.video-item iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.publication-card {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 1rem;
  align-items: start;
}

.publication-card img {
  width: 100%;
  border-radius: 8px;
  border: 1px solid var(--line);
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.btn {
  display: inline-block;
  background: #efefef;
  border: 1px solid #cfd6de;
  color: #1c2026;
  border-radius: 6px;
  padding: 0.35rem 0.62rem;
  font-weight: 700;
}

.btn:hover {
  text-decoration: none;
  background: #e4e9ef;
}

.codeblock {
  border: 1px solid #d7dde4;
  border-radius: 8px;
  background: #f4f7fb;
  padding: 0.9rem;
  overflow-x: auto;
  white-space: pre;
  font-size: 0.9rem;
}

.changelog {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid #e2e8ef;
}

.changelog li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.8rem;
  border-bottom: 1px solid #e2e8ef;
  padding: 0.75rem 0.45rem;
}

.changelog time {
  color: var(--muted);
  white-space: nowrap;
}

.hero-image {
  width: min(880px, 100%);
  display: block;
  margin: 0 0 0.85rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.figure-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
}

.figure-grid img {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 0;
  background: #fff;
  display: block;
}

code {
  background: #f0f3f7;
  border: 1px solid #dde4eb;
  border-radius: 4px;
  padding: 0.08rem 0.34rem;
  font-size: 0.9em;
}

.site-footer {
  border-top: 1px solid #d8dee5;
  background: #eef2f6;
  padding: 1rem 0;
}

.site-footer p {
  margin: 0;
  color: var(--muted);
}

.sep {
  margin: 0 0.35rem;
  color: #9aa3ad;
}

@media (max-width: 840px) {
  .publication-card {
    grid-template-columns: 1fr;
  }

  .brand span {
    display: none;
  }

  .topbar-inner {
    min-height: 54px;
  }

  nav a {
    padding: 0.45rem 0.6rem;
    font-size: 0.95rem;
  }

  .page {
    margin-top: 76px;
  }

  .changelog li {
    grid-template-columns: 1fr;
    gap: 0.2rem;
  }

  .figure-grid {
    grid-template-columns: 1fr;
  }
}
