:root {
  --lopo-ink: #14212b;
  --lopo-muted: #5f6b76;
  --lopo-accent: #087f8c;
  --lopo-accent-dark: #055b63;
  --lopo-highlight: #e0a43a;
  --lopo-paper: #fcfcfa;
  --lopo-surface: #f3f7f6;
  --lopo-border: #dce5e6;
  --lopo-shadow: 0 18px 50px rgba(20, 33, 43, 0.08);
}

/* Typography and reading rhythm */
body {
  color: var(--lopo-ink);
  background: var(--lopo-paper);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  text-rendering: optimizeLegibility;
}

.post-container {
  font-size: 17px;
  line-height: 1.85;
}

.post-container p,
.post-container li {
  color: #27333d;
}

.post-container h2 {
  margin-top: 2.2em;
  padding-bottom: 0.35em;
  border-bottom: 1px solid var(--lopo-border);
}

.post-container h3 {
  margin-top: 1.8em;
}

.post-container a {
  color: var(--lopo-accent-dark);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.post-container img {
  height: auto;
  border-radius: 10px;
}

/* Code blocks */
.chroma {
  overflow-x: auto;
  border-radius: 8px;
}

.chroma .lnt {
  display: none;
}

.chroma pre {
  padding: 1em 1.15em;
}

/* Navigation and sidebar */
.navbar-custom .navbar-brand,
.navbar-custom .nav li a {
  letter-spacing: 0.04em;
}

.navbar-custom .nav li a:focus-visible,
.navbar-custom .nav li a:hover {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 5px;
}

.short-about img {
  width: 140px;
  height: 140px;
  object-fit: cover;
  border: 3px solid #fff;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.14);
}

.radar-links {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.radar-links a {
  display: block;
  padding: 12px 14px;
  color: var(--lopo-ink);
  background: var(--lopo-surface);
  border: 1px solid var(--lopo-border);
  border-radius: 8px;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.radar-links a:hover {
  border-color: var(--lopo-accent);
  transform: translateY(-1px);
  text-decoration: none;
}

.radar-links small {
  display: block;
  margin-top: 4px;
  color: var(--lopo-muted);
  line-height: 1.5;
}

.sidebar-container,
.sidebar-container p,
.sidebar-container small {
  color: #4d5a64;
}

.sidebar-container h5,
.sidebar-container h5 a {
  color: var(--lopo-ink);
}

/* Homepage identity */
.home-hero {
  position: relative;
  display: flex;
  min-height: 600px;
  margin-bottom: 0;
  color: #fff;
  background-position: center;
  background-size: cover;
}

.home-hero .container {
  display: flex;
  align-items: center;
  width: 100%;
}

.home-hero__content {
  max-width: 830px;
  padding: 145px 0 92px;
}

.home-hero__eyebrow,
.home-section-heading > p,
.home-feed__heading p,
.comments-panel__eyebrow {
  margin: 0 0 14px;
  color: #7dd3d8;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
}

.home-hero h1 {
  max-width: 760px;
  margin: 0;
  color: #fff;
  font-size: clamp(42px, 6vw, 72px);
  font-weight: 760;
  line-height: 1.13;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.home-hero__lead {
  max-width: 720px;
  margin: 25px 0 0;
  color: rgba(255, 255, 255, 0.84);
  font-size: 19px;
  line-height: 1.75;
}

.home-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

.home-button {
  display: inline-flex;
  align-items: center;
  min-height: 46px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 700;
  transition: transform 0.2s ease, background-color 0.2s ease;
}

.home-button:hover,
.home-button:focus {
  transform: translateY(-1px);
  text-decoration: none;
}

.home-button--primary {
  color: #0d2930;
  background: #83dce0;
}

.home-button--primary:hover,
.home-button--primary:focus {
  color: #0d2930;
  background: #a3e8eb;
}

.home-button--ghost {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.05);
}

.home-button--ghost:hover,
.home-button--ghost:focus {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}

.home-hero__facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  max-width: 780px;
  margin: 48px 0 0;
  padding: 26px 0 0;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  list-style: none;
}

.home-hero__facts strong,
.home-hero__facts span {
  display: block;
}

.home-hero__facts strong {
  color: #fff;
  font-size: 16px;
}

.home-hero__facts span {
  margin-top: 5px;
  color: rgba(255, 255, 255, 0.65);
  font-size: 13px;
  line-height: 1.55;
}

/* Homepage content paths */
.home-paths {
  padding: 82px 0 74px;
  background: #fff;
}

.home-section-heading {
  max-width: 680px;
  margin-bottom: 30px;
}

.home-section-heading > p,
.home-feed__heading p {
  color: var(--lopo-accent);
}

.home-section-heading h2,
.home-feed__heading h2 {
  margin: 0;
  color: var(--lopo-ink);
  font-size: 32px;
  line-height: 1.25;
}

.home-paths__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.home-path-card {
  position: relative;
  min-height: 210px;
  padding: 30px;
  overflow: hidden;
  background: var(--lopo-surface);
  border: 1px solid var(--lopo-border);
  border-radius: 14px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease,
    transform 0.2s ease;
}

.home-path-card:hover {
  border-color: #a9cacc;
  box-shadow: var(--lopo-shadow);
  transform: translateY(-3px);
}

.home-path-card > span {
  color: var(--lopo-highlight);
  font-family: Georgia, serif;
  font-size: 15px;
  font-style: italic;
}

.home-path-card h3 {
  margin: 42px 0 12px;
  color: var(--lopo-ink);
  font-size: 22px;
}

.home-path-card p {
  margin: 0;
  color: var(--lopo-muted);
  font-size: 15px;
  line-height: 1.7;
}

/* Homepage article feed */
.home-feed {
  padding: 76px 0 40px;
}

.home-feed__heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.home-feed__heading > a {
  padding-bottom: 4px;
  color: var(--lopo-accent-dark);
  font-size: 14px;
  font-weight: 700;
}

.home-feed__list .post-preview {
  margin: 0 0 18px;
  padding: 26px 28px;
  background: #fff;
  border: 1px solid var(--lopo-border);
  border-radius: 12px;
  box-shadow: 0 8px 28px rgba(20, 33, 43, 0.04);
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.home-feed__list .post-preview:hover {
  border-color: #a9cacc;
  transform: translateY(-2px);
}

.home-feed__list .post-preview h2 {
  margin-top: 0;
  border-bottom: 0;
  font-size: 26px;
  line-height: 1.35;
}

.home-feed__list .post-content-preview {
  margin-top: 10px;
  color: var(--lopo-muted);
  font-size: 15px;
  line-height: 1.75;
}

.home-feed__list .post-meta {
  margin-bottom: 0;
}

.home-feed__list hr {
  display: none;
}

/* Table of contents and comments */
.article-toc {
  margin: 0 0 2em;
  padding: 14px 18px;
  background: var(--lopo-surface);
  border: 1px solid var(--lopo-border);
  border-radius: 8px;
}

.article-toc summary {
  color: var(--lopo-accent-dark);
  font-weight: 700;
  cursor: pointer;
}

.article-toc nav {
  margin-top: 12px;
}

.comments-panel {
  margin-top: 58px;
  padding-top: 30px;
  border-top: 1px solid var(--lopo-border);
}

.comments-panel h2 {
  margin: 0 0 10px;
  border: 0;
  font-size: 26px;
}

.comments-panel > p:not(.comments-panel__eyebrow) {
  margin-bottom: 22px;
  color: var(--lopo-muted);
  font-size: 14px;
}

.giscus-comments {
  min-height: 160px;
}

/* Accessible focus indicator */
a:focus-visible,
button:focus-visible,
summary:focus-visible {
  outline: 3px solid #f3b61f;
  outline-offset: 3px;
}

@media (max-width: 991px) {
  .home-hero {
    min-height: 560px;
  }

  .home-paths__grid {
    grid-template-columns: 1fr;
  }

  .home-path-card {
    min-height: 0;
  }

  .home-path-card h3 {
    margin-top: 24px;
  }
}

@media (max-width: 767px) {
  .intro-header .site-heading h1,
  .intro-header .post-heading h1 {
    font-size: 34px;
    line-height: 1.2;
  }

  .intro-header .site-heading .subheading {
    font-size: 17px;
    line-height: 1.55;
  }

  .post-container {
    font-size: 16px;
    line-height: 1.8;
  }

  .home-hero {
    min-height: auto;
  }

  .home-hero__content {
    padding: 118px 0 64px;
  }

  .home-hero h1 {
    font-size: 40px;
  }

  .home-hero__lead {
    font-size: 17px;
  }

  .home-hero__facts {
    grid-template-columns: 1fr;
    gap: 16px;
    margin-top: 36px;
  }

  .home-paths,
  .home-feed {
    padding-top: 56px;
  }

  .home-section-heading h2,
  .home-feed__heading h2 {
    font-size: 28px;
  }

  .home-feed__heading {
    align-items: flex-start;
  }

  .home-feed__list .post-preview {
    padding: 22px 20px;
  }

  .home-feed__list .post-preview h2 {
    font-size: 23px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
