@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&family=Newsreader:opsz,wght@6..72,400;6..72,600;6..72,700&display=swap');

:root {
  --bg: #f7f5ef;
  --paper: #fffdf7;
  --ink: #1f2530;
  --muted: #5f6a78;
  --line: #d8d2c2;
  --primary: #1769e0;
  --primary-soft: #d9e8ff;
  --accent: #ff6b35;
  --accent-soft: #ffe3d8;
  --shadow: 0 18px 50px rgba(24, 38, 58, 0.12);
  --radius-lg: 22px;
  --radius-md: 16px;
}

* {
  box-sizing: border-box;
}

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

body {
  font-family: 'Manrope', 'Avenir Next', 'Segoe UI', sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 90% -15%, #cde3ff 0%, rgba(205, 227, 255, 0) 42%),
    radial-gradient(circle at -10% 40%, #ffe3d3 0%, rgba(255, 227, 211, 0) 35%),
    var(--bg);
  line-height: 1.6;
}

a {
  color: inherit;
  text-decoration: none;
}

.top-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  z-index: 100;
  background: rgba(23, 105, 224, 0.14);
}

.top-progress span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--primary), #31b6ff);
  transition: width 100ms linear;
}

.container {
  width: min(1120px, 92vw);
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(10px);
  background: rgba(247, 245, 239, 0.88);
  border-bottom: 1px solid rgba(216, 210, 194, 0.75);
}

.nav {
  min-height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  letter-spacing: 0.2px;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(216, 210, 194, 0.9);
  background: #fff;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 20px;
}

.nav-links a {
  color: var(--muted);
  font-weight: 600;
  transition: color 200ms ease;
}

.nav-links a:hover,
.nav-links a.is-active {
  color: var(--ink);
}

.hero {
  padding: 72px 0 34px;
  position: relative;
}

.hero::after {
  content: '';
  position: absolute;
  right: -40px;
  top: 35px;
  width: 210px;
  height: 210px;
  border-radius: 50%;
  border: 2px dashed rgba(23, 105, 224, 0.24);
  pointer-events: none;
}

.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--primary);
  background: var(--primary-soft);
  border-radius: 100px;
  padding: 8px 14px;
}

.hero h1 {
  margin: 16px 0 14px;
  font-family: 'Newsreader', Georgia, serif;
  font-size: clamp(2rem, 5vw, 4rem);
  font-weight: 700;
  line-height: 1.03;
  letter-spacing: -0.5px;
}

.hero p {
  margin: 0;
  font-size: 1.06rem;
  color: var(--muted);
  max-width: 66ch;
}

.hero-actions {
  margin-top: 28px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.btn {
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  font-weight: 700;
  letter-spacing: 0.15px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-primary {
  background: linear-gradient(120deg, var(--primary), #43c1ff);
  color: #fff;
  box-shadow: 0 10px 22px rgba(23, 105, 224, 0.35);
}

.btn-soft {
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
}

.section {
  padding: 28px 0 42px;
}

.section-title {
  margin: 0 0 18px;
  font-family: 'Newsreader', Georgia, serif;
  font-size: clamp(1.5rem, 3.2vw, 2.2rem);
}

.topic-subtitle {
  margin: -4px 0 18px;
  color: var(--muted);
  font-size: 0.96rem;
}

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

.topic-card {
  position: relative;
  background: var(--paper);
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  overflow: hidden;
  min-height: 220px;
  box-shadow: var(--shadow);
  transform: rotate(var(--card-tilt, 0deg));
  transition: transform 220ms ease, box-shadow 220ms ease;
}

.topic-card:hover {
  transform: translateY(-6px) rotate(var(--card-tilt, 0deg));
  box-shadow: 0 24px 44px rgba(23, 42, 58, 0.2);
}

.topic-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  inset: 0;
}

.topic-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(130deg, rgba(15, 20, 28, 0.82), rgba(15, 20, 28, 0.38)),
    radial-gradient(circle at 85% 10%, var(--topic-accent, #1769e0) 0%, rgba(0, 0, 0, 0) 45%);
}

.topic-content {
  position: relative;
  z-index: 1;
  color: #fff;
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 220px;
}

.topic-content h3 {
  margin: 0;
  font-size: 1.35rem;
}

.topic-content p {
  margin: 8px 0 16px;
  opacity: 0.92;
}

.topic-badge {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  margin-bottom: 10px;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.35);
}

.topic-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topic-pill {
  font-size: 0.76rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 100px;
  padding: 5px 10px;
}

.controls {
  margin: 10px 0 18px;
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 12px;
}

.search-box,
.select-box {
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  height: 48px;
  padding: 0 16px;
  font: inherit;
  color: var(--ink);
}

.search-box:focus,
.select-box:focus {
  outline: 2px solid rgba(23, 105, 224, 0.3);
  outline-offset: 1px;
}

.filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.filter-pills button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  font: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  border-radius: 999px;
  padding: 7px 12px;
  cursor: pointer;
  transition: all 180ms ease;
}

.filter-pills button.is-active,
.filter-pills button:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
}

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

.article-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 12px 34px rgba(23, 42, 58, 0.09);
  transition: transform 220ms ease, box-shadow 220ms ease;
}

.article-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 16px 42px rgba(23, 42, 58, 0.16);
}

.article-card img {
  width: 100%;
  height: 170px;
  object-fit: cover;
}

.article-body {
  padding: 16px 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}

.article-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 0.8rem;
}

.badge-topic {
  background: #eef3ff;
  color: var(--primary);
  border-radius: 999px;
  padding: 4px 9px;
  font-weight: 700;
}

.article-card h3 {
  margin: 0;
  font-size: 1.06rem;
  line-height: 1.38;
}

.article-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.article-tags span {
  font-size: 0.73rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  padding: 4px 9px;
  color: var(--muted);
}

.read-link {
  margin-top: auto;
  color: var(--primary);
  font-weight: 700;
  font-size: 0.88rem;
}

.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 420ms ease, transform 420ms ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

.empty-state {
  border: 1px dashed var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.7);
  padding: 18px;
  color: var(--muted);
}

.site-footer {
  margin-top: 26px;
  border-top: 1px solid var(--line);
  padding: 24px 0 36px;
  color: var(--muted);
  font-size: 0.92rem;
}

.common-footer {
  display: grid;
  gap: 4px;
}

.footer-title {
  margin: 0;
  font-family: 'Newsreader', Georgia, serif;
  font-size: 1.35rem;
  color: var(--ink);
}

.footer-line {
  margin: 0;
}

.footer-email {
  color: var(--primary);
  font-weight: 700;
  width: fit-content;
}

.footer-email:hover {
  text-decoration: underline;
}

.article-hero {
  margin-top: 28px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  position: relative;
}

.article-hero img {
  display: block;
  width: 100%;
  height: min(420px, 50vw);
  min-height: 250px;
  object-fit: cover;
}

.article-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(15, 20, 28, 0.1), rgba(15, 20, 28, 0.68));
  display: flex;
  align-items: flex-end;
}

.article-hero-content {
  padding: 24px;
  color: #fff;
}

.breadcrumb {
  margin: 24px 0 12px;
  font-size: 0.84rem;
  color: var(--muted);
}

.breadcrumb a {
  color: var(--muted);
}

.breadcrumb a:hover {
  color: var(--ink);
}

.article-layout {
  display: grid;
  grid-template-columns: minmax(0, 760px) 260px;
  gap: 30px;
  padding: 24px 0 40px;
}

.article-content {
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 26px;
}

.article-content h2 {
  margin: 0 0 10px;
  font-family: 'Newsreader', Georgia, serif;
  font-size: 1.8rem;
}

.article-content p {
  margin: 0 0 14px;
  color: #2e3542;
  font-size: 1.03rem;
}

.article-content ul {
  margin: 0 0 14px;
  padding-left: 20px;
}

.article-content li {
  margin: 0 0 7px;
}

.article-content pre {
  margin: 8px 0 18px;
  background: #161b24;
  color: #d7e2f3;
  border-radius: 12px;
  padding: 14px;
  overflow-x: auto;
  font-size: 0.86rem;
  line-height: 1.45;
}

.article-section {
  margin-bottom: 24px;
}

.article-section:last-child {
  margin-bottom: 0;
}

.toc {
  position: sticky;
  top: 92px;
  align-self: start;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.75);
  border-radius: var(--radius-md);
  padding: 14px;
}

.toc h4 {
  margin: 0 0 10px;
  font-size: 0.95rem;
}

.toc a {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0 0 7px;
}

.toc a:hover {
  color: var(--primary);
}

.related-grid {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.related-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  padding: 12px;
}

.related-card h5 {
  margin: 0 0 8px;
  font-size: 0.96rem;
}

.related-card p {
  margin: 0;
  font-size: 0.84rem;
  color: var(--muted);
}

.topic-load-more-wrap {
  display: flex;
  justify-content: center;
  margin-top: 18px;
}

.topic-load-more {
  min-width: 190px;
}

.topic-reading-layout {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.topic-index-panel {
  position: sticky;
  top: 88px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.78);
  padding: 16px;
}

.topic-index-panel h2 {
  margin: 0;
  font-family: 'Newsreader', Georgia, serif;
  font-size: 1.35rem;
}

.topic-index-meta {
  margin: 6px 0 14px;
  color: var(--muted);
  font-size: 0.88rem;
}

.topic-index-search {
  width: 100%;
  margin-bottom: 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  height: 40px;
  padding: 0 12px;
  font: inherit;
  font-size: 0.9rem;
  color: var(--ink);
}

.topic-index-search:focus {
  outline: 2px solid rgba(23, 105, 224, 0.3);
  outline-offset: 1px;
}

.topic-index-links {
  display: grid;
  gap: 8px;
}

.topic-index-link {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  border-radius: 10px;
  border: 1px solid transparent;
  padding: 9px;
  transition: all 150ms ease;
  color: #2b3442;
}

.topic-index-link:hover {
  border-color: var(--line);
  background: #fff;
}

.topic-index-link.is-active {
  border-color: rgba(23, 105, 224, 0.3);
  background: var(--primary-soft);
}

.topic-index-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 24px;
  border-radius: 8px;
  font-size: 0.74rem;
  font-weight: 700;
  background: rgba(23, 105, 224, 0.1);
  color: var(--primary);
}

.topic-index-link strong {
  display: block;
  font-size: 0.88rem;
  line-height: 1.35;
}

.topic-index-link small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.78rem;
}

.topic-index-empty {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.topic-content-column {
  display: grid;
  gap: 16px;
}

.topic-article {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.82);
  padding: 24px;
  scroll-margin-top: 92px;
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

.topic-article.is-active {
  border-color: rgba(23, 105, 224, 0.35);
  box-shadow: 0 10px 28px rgba(23, 105, 224, 0.1);
}

.topic-article-header {
  margin-bottom: 16px;
}

.topic-article h2 {
  margin: 0;
  font-family: 'Newsreader', Georgia, serif;
  font-size: clamp(1.6rem, 2.5vw, 2.2rem);
  line-height: 1.12;
}

.topic-article-meta {
  margin: 8px 0 10px;
  color: var(--muted);
  font-size: 0.88rem;
}

.topic-article-excerpt {
  margin: 0 0 12px;
  color: #344152;
}

.topic-article-body p {
  margin: 0 0 13px;
  color: #2e3542;
  font-size: 1.01rem;
}

.topic-article-body ul {
  margin: 0 0 13px;
  padding-left: 20px;
}

.topic-article-body li {
  margin-bottom: 6px;
}

.topic-article-body pre {
  margin: 8px 0 18px;
  background: #161b24;
  color: #d7e2f3;
  border-radius: 12px;
  padding: 14px;
  overflow-x: auto;
  font-size: 0.86rem;
  line-height: 1.45;
}

.topic-article-section h3 {
  margin: 0 0 10px;
  font-family: 'Newsreader', Georgia, serif;
  font-size: 1.4rem;
}

.topic-article-section {
  margin-bottom: 22px;
}

.topic-article-section:last-child {
  margin-bottom: 0;
}

@media (max-width: 1024px) {
  .article-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .article-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .toc {
    position: static;
  }

  .topic-reading-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .topic-index-panel {
    position: static;
  }
}

@media (max-width: 760px) {
  .nav {
    min-height: 66px;
    gap: 10px;
  }

  .nav-links {
    gap: 13px;
    font-size: 0.9rem;
  }

  .hero {
    padding-top: 54px;
  }

  .hero::after {
    display: none;
  }

  .topic-grid,
  .article-grid,
  .related-grid {
    grid-template-columns: 1fr;
  }

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

  .topic-article {
    padding: 18px;
  }

  .article-content {
    padding: 20px 18px;
  }

  .article-content h2 {
    font-size: 1.5rem;
  }
}
