:root {
  --bg: #09111f;
  --surface: #0f1a2b;
  --surface-2: #142238;
  --surface-3: #182b45;
  --border: #24344e;
  --text: #f7fafc;
  --muted: #a8b4c7;
  --soft: #d6deea;
  --blue: #2563eb;
  --blue-2: #60a5fa;
  --green: #22c55e;
  --amber: #f59e0b;
  --shadow: 0 18px 44px rgba(1, 8, 20, .28);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

:where(
  body,
  .post-toc,
  .admin-preview-toc,
  .marktext-command-menu,
  .marktext-input,
  .post-list,
  .table-scroll
) {
  scrollbar-width: thin;
  scrollbar-color: rgba(96, 165, 250, .58) rgba(7, 16, 32, .72);
}

:where(
  body,
  .post-toc,
  .admin-preview-toc,
  .marktext-command-menu,
  .marktext-input,
  .table-scroll
)::-webkit-scrollbar {
  width: 10px;
}

.post-list::-webkit-scrollbar {
  height: 10px;
}

:where(
  body,
  .post-toc,
  .admin-preview-toc,
  .marktext-command-menu,
  .marktext-input,
  .post-list,
  .table-scroll
)::-webkit-scrollbar-track {
  border-radius: 999px;
  background: rgba(7, 16, 32, .72);
}

:where(.post-toc, .admin-preview-toc)::-webkit-scrollbar-track {
  margin: 14px 0;
}

:where(
  body,
  .post-toc,
  .admin-preview-toc,
  .marktext-command-menu,
  .marktext-input,
  .table-scroll
)::-webkit-scrollbar-thumb {
  border: 2px solid rgba(7, 16, 32, .72);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(96, 165, 250, .9), rgba(37, 99, 235, .72));
}

.post-list::-webkit-scrollbar-thumb {
  border: 2px solid rgba(7, 16, 32, .72);
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(96, 165, 250, .9), rgba(37, 99, 235, .72));
}

:where(
  body,
  .post-toc,
  .admin-preview-toc,
  .marktext-command-menu,
  .marktext-input,
  .table-scroll
)::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(147, 197, 253, .95), rgba(37, 99, 235, .86));
}

.post-list::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(90deg, rgba(147, 197, 253, .95), rgba(37, 99, 235, .86));
}

body {
  margin: 0;
  padding-top: 69px;
  font-family: "Segoe UI", Arial, sans-serif;
  background:
    linear-gradient(180deg, rgba(37, 99, 235, .08), transparent 360px),
    var(--bg);
  color: var(--text);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .035) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: linear-gradient(to bottom, black, transparent 70%);
}

a {
  color: inherit;
}

img {
  max-width: 100%;
}

header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px 32px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  background: rgba(9, 17, 31, .88);
  backdrop-filter: blur(14px);
}

.brand-link {
  display: inline-flex;
  align-items: center;
  min-width: 150px;
}

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

nav {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

nav a {
  color: var(--soft);
  text-decoration: none;
  padding: 9px 12px;
  border-radius: 8px;
  font-weight: 650;
  font-size: 14px;
}

nav a:hover,
nav a.active {
  color: white;
  background: rgba(37, 99, 235, .18);
}

.section {
  width: min(1120px, 100%);
  margin: auto;
  padding: 64px 24px;
  position: relative;
}

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

.section-eyebrow {
  color: var(--blue-2);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  margin: 0 0 10px;
}

.section-title {
  font-size: 34px;
  line-height: 1.12;
  margin: 0;
}

.section-copy {
  color: var(--muted);
  line-height: 1.7;
  margin: 12px 0 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 12px 18px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--blue);
  color: white;
  text-decoration: none;
  font-weight: 800;
  box-shadow: 0 12px 26px rgba(37, 99, 235, .26);
}

.btn:hover {
  background: #1d4ed8;
}

.btn.secondary {
  background: transparent;
  border-color: var(--border);
  color: var(--soft);
  box-shadow: none;
}

.btn.secondary:hover {
  border-color: var(--blue-2);
  color: white;
}

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

.card {
  display: block;
  height: 100%;
  color: inherit;
  text-decoration: none;
  background: rgba(15, 26, 43, .92);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  box-shadow: var(--shadow);
  transition: transform .2s ease, border-color .2s ease, background .2s ease;
}

.card:hover {
  transform: translateY(-4px);
  border-color: rgba(96, 165, 250, .7);
  background: rgba(20, 34, 56, .96);
}

.thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 6px;
  margin-bottom: 14px;
  display: block;
  background: var(--surface-2);
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  background: rgba(34, 197, 94, .12);
  border: 1px solid rgba(34, 197, 94, .34);
  color: #86efac;
  font-size: 12px;
  font-weight: 800;
  padding: 5px 9px;
  border-radius: 999px;
  margin-bottom: 12px;
}

.card h3 {
  margin: 0 0 10px;
  font-size: 20px;
  line-height: 1.3;
}

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

.card small {
  color: var(--blue-2);
  font-weight: 800;
}

.page-hero {
  padding-top: 72px;
  padding-bottom: 40px;
}

.page-hero h1 {
  max-width: 820px;
  font-size: 52px;
  line-height: 1.05;
  margin: 0;
}

.page-hero p {
  max-width: 740px;
  color: var(--muted);
  font-size: 19px;
  line-height: 1.7;
  margin: 18px 0 0;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.feature {
  background: rgba(15, 26, 43, .82);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 22px;
}

.feature strong {
  display: block;
  font-size: 18px;
  margin-bottom: 8px;
}

.feature p {
  color: var(--muted);
  line-height: 1.65;
  margin: 0;
}

.split {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 28px;
  align-items: start;
}

.panel {
  background: rgba(15, 26, 43, .9);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 24px;
}

.panel h2,
.panel h3 {
  margin-top: 0;
}

.panel p,
.panel li {
  color: var(--muted);
  line-height: 1.7;
}

.contact-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 12px;
}

.contact-list a {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  text-decoration: none;
  background: rgba(20, 34, 56, .62);
}

.contact-list a:hover {
  border-color: var(--blue-2);
}

.empty-state {
  grid-column: 1 / -1;
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(15, 26, 43, .78);
}

footer {
  margin-top: 32px;
  padding: 42px 24px 24px;
  border-top: 1px solid rgba(255, 255, 255, .08);
  color: var(--muted);
  position: relative;
}

.footer-inner {
  width: min(1180px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.25fr .7fr .95fr 1.55fr;
  gap: 52px;
  align-items: start;
}

.footer-logo {
  width: 150px;
  height: auto;
  display: block;
  margin-bottom: 18px;
}

.footer-brand p,
.footer-author p {
  margin: 0;
  color: var(--soft);
  line-height: 1.55;
}

.footer-social {
  display: flex;
  gap: 16px;
  margin-top: 22px;
}

.footer-social a {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: white;
  text-decoration: none;
}

.footer-social a:hover {
  background: var(--blue-2);
}

.footer-social img {
  width: 20px;
  height: 20px;
  object-fit: contain;
  display: block;
}

.footer-nav h2,
.footer-author h2 {
  margin: 0 0 18px;
  color: var(--text);
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0;
}

.footer-nav {
  display: grid;
  gap: 10px;
}

.footer-nav a {
  color: var(--soft);
  text-decoration: none;
  line-height: 1.25;
  padding: 0;
  border-radius: 0;
  background: transparent;
  font-weight: 600;
  font-size: 15px;
}

.footer-nav a:hover,
.footer-nav a.active,
.footer-bottom a:hover {
  color: white;
  background: transparent;
}

.footer-author-card {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 18px;
  align-items: start;
}

.footer-author-card img {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, .45);
  background: var(--surface-2);
}

.footer-author-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  margin-top: 14px;
  padding: 8px 14px;
  border: 1px solid rgba(37, 99, 235, .72);
  border-radius: 8px;
  color: white;
  text-decoration: none;
  font-weight: 800;
}

.footer-author-link:hover {
  background: rgba(37, 99, 235, .18);
}

.footer-bottom {
  width: min(1180px, 100%);
  margin: 32px auto 0;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, .08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.footer-bottom small {
  color: var(--muted);
}

.footer-bottom div {
  display: flex;
  gap: 34px;
  flex-wrap: wrap;
}

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

@media (max-width: 820px) {
  body {
    padding-top: 122px;
  }

  header {
    align-items: flex-start;
    flex-direction: column;
    padding: 14px 18px;
  }

  nav {
    justify-content: flex-start;
  }

  nav a {
    padding: 8px 10px;
  }

  .section {
    padding: 44px 18px;
  }

  .section-header,
  .split,
  .feature-grid,
  .footer-inner {
    display: grid;
    grid-template-columns: 1fr;
  }

  .footer-inner {
    gap: 34px;
  }

  .footer-author-card {
    max-width: 620px;
  }

  .footer-bottom {
    align-items: flex-start;
    flex-direction: column;
  }

  .page-hero h1 {
    font-size: 38px;
  }
}

@media (max-width: 520px) {
  .brand-logo {
    height: 34px;
  }

  .page-hero h1,
  .section-title {
    font-size: 32px;
  }

  .page-hero p {
    font-size: 17px;
  }
}
