:root {
  --primary: #4338ca;
  --primary-dark: #353166;
  --ink: #323c49;
  --text: #434f61;
  --muted: #718096;
  --line: #e2e8f0;
  --panel: #f7f7f9;
  --white: #ffffff;
  --focus: rgba(80, 73, 162, 0.25);
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  color: var(--text);
  background: var(--white);
  line-height: 1.6;
}

a {
  color: var(--primary);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}

img {
  max-width: 100%;
  height: auto;
}

.site-header {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px clamp(20px, 4vw, 56px);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  font-weight: 750;
  text-decoration: none;
}

.brand img {
  width: 46px;
  height: 48px;
}

.top-nav {
  display: flex;
  gap: 18px;
  font-size: 0.94rem;
}

.top-nav a {
  color: var(--text);
  text-decoration: none;
}

.home-hero {
  background: linear-gradient(120deg, rgba(67, 56, 202, 0.95), rgba(53, 49, 102, 0.9)), url("/assets/theme/homepage_background_image.png");
  background-size: auto, 260px;
  color: white;
  padding: clamp(56px, 9vw, 104px) 20px;
}

.hero-inner {
  width: min(980px, 100%);
  margin: 0 auto;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.78rem;
  font-weight: 800;
  opacity: 0.78;
}

h1, h2, h3, h4, h5, h6 {
  color: var(--ink);
  line-height: 1.18;
  letter-spacing: 0;
}

.home-hero h1 {
  color: white;
  margin: 0;
  font-size: clamp(2.35rem, 7vw, 5rem);
  max-width: 900px;
}

.hero-copy {
  max-width: 700px;
  margin: 18px 0 30px;
  font-size: 1.16rem;
  color: rgba(255, 255, 255, 0.88);
}

.search-box {
  position: relative;
  width: min(760px, 100%);
}

.search-box input {
  width: 100%;
  min-height: 56px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 18px;
  font: inherit;
  color: var(--ink);
  background: white;
  box-shadow: 0 18px 50px rgba(14, 20, 37, 0.16);
}

.search-box input:focus {
  outline: 4px solid var(--focus);
  border-color: var(--primary);
}

.search-results {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 8px);
  max-height: 420px;
  overflow: auto;
  background: white;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 24px 60px rgba(14, 20, 37, 0.2);
  z-index: 20;
}

.search-results a {
  display: block;
  padding: 14px 16px;
  text-decoration: none;
  border-bottom: 1px solid var(--line);
}

.search-results a:last-child {
  border-bottom: 0;
}

.search-results strong {
  display: block;
  color: var(--ink);
}

.search-results span {
  display: block;
  color: var(--muted);
  font-size: 0.88rem;
}

.content-band,
.page-shell {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 48px 0;
}

.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.section-header h2,
.page-heading h1,
.article-header h1 {
  margin: 0;
}

.section-header p,
.page-heading p,
.article-header p {
  color: var(--muted);
  margin: 8px 0 0;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(245px, 1fr));
  gap: 18px;
}

.category-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
  min-height: 230px;
  background: white;
}

.category-card h2 {
  font-size: 1.18rem;
  margin: 0 0 8px;
}

.category-card p {
  margin: 0 0 16px;
  color: var(--muted);
}

.category-card ul,
.recent-list,
.article-list,
.article-sidebar ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.category-card li + li,
.recent-list li + li,
.article-list li + li {
  margin-top: 10px;
}

.recent-band {
  padding-top: 8px;
}

.recent-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px 28px;
}

.recent-list a,
.article-list a {
  font-weight: 700;
}

.recent-list span {
  display: block;
  color: var(--muted);
  font-size: 0.9rem;
}

.breadcrumbs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 28px;
  color: var(--muted);
  font-size: 0.9rem;
}

.breadcrumbs a {
  color: var(--muted);
  text-decoration: none;
}

.listing-section {
  border-top: 1px solid var(--line);
  padding: 28px 0;
}

.listing-section h2 {
  margin-top: 0;
}

.article-list li {
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.article-list p {
  margin: 6px 0 0;
  color: var(--muted);
}

.article-shell {
  width: min(1240px, calc(100% - 40px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: 280px minmax(0, 780px);
  gap: clamp(28px, 5vw, 72px);
  padding: 42px 0 64px;
}

.article-sidebar {
  position: sticky;
  top: 96px;
  max-height: calc(100vh - 120px);
  overflow: auto;
  align-self: start;
  border-right: 1px solid var(--line);
  padding-right: 22px;
}

.sidebar-section + .sidebar-section {
  margin-top: 24px;
}

.sidebar-heading {
  display: block;
  font-weight: 800;
  color: var(--ink);
  text-decoration: none;
  margin-bottom: 10px;
}

.article-sidebar li + li {
  margin-top: 8px;
}

.article-sidebar a {
  color: var(--text);
  text-decoration: none;
  font-size: 0.92rem;
}

.article-sidebar a[aria-current="page"] {
  color: var(--primary);
  font-weight: 800;
}

.article-main {
  min-width: 0;
}

.article-header {
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 30px;
}

.article-header h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
}

.article-content {
  font-size: 1.02rem;
}

.article-content h2 {
  margin-top: 2.1em;
  padding-top: 0.3em;
}

.article-content h3,
.article-content h4 {
  margin-top: 1.8em;
}

.article-content p,
.article-content ul,
.article-content ol,
.article-content blockquote,
.article-content pre,
.article-content .table-wrap {
  margin: 1.05em 0;
}

.article-content img {
  display: block;
  margin: 18px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.article-content blockquote {
  border-left: 4px solid var(--primary);
  padding-left: 18px;
  color: var(--muted);
}

.article-content code {
  background: var(--panel);
  padding: 0.16em 0.32em;
  border-radius: 4px;
}

.article-content pre {
  overflow: auto;
  background: #101827;
  color: #f7f7f9;
  padding: 18px;
  border-radius: 8px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  border: 1px solid var(--line);
  padding: 10px 12px;
  vertical-align: top;
  text-align: left;
}

th {
  background: var(--panel);
  color: var(--ink);
}

.site-footer {
  border-top: 1px solid var(--line);
  padding: 26px clamp(20px, 4vw, 56px);
  color: var(--muted);
  font-size: 0.9rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.not-found {
  min-height: 50vh;
}

@media (max-width: 860px) {
  .site-header {
    position: static;
    align-items: flex-start;
    flex-direction: column;
  }

  .section-header {
    display: block;
  }

  .article-shell {
    display: block;
  }

  .article-sidebar {
    position: static;
    max-height: none;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 0 0 24px;
    margin-bottom: 28px;
  }
}
