:root {
  --background: #fbf7ff;
  --surface: #ffffff;
  --surface-soft: #f7f3ff;
  --foreground: #312a3c;
  --muted: #675f73;
  --muted-strong: #4c4458;
  --border: #dfd8ea;
  --primary: #8a2be2;
  --primary-strong: #731fcb;
  --accent: #1584bd;
  --success: #23845f;
  --warning: #b67615;
  --ink: #0f172a;
  --radius: 8px;
  --shadow: 0 18px 42px -32px rgba(49, 42, 60, 0.32);
  --font-sans: Montserrat, var(--gh-font-body, Arial), sans-serif;
  --font-heading: Montserrat, var(--gh-font-heading, Arial), sans-serif;
  --font-mono: "Fira Code", ui-monospace, monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  color-scheme: light;
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  overflow-x: hidden;
  background: linear-gradient(180deg, var(--background) 0%, var(--surface-soft) 48%, #f1eef8 100%);
  color: var(--foreground);
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

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

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

img,
picture,
svg {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

::selection {
  background: rgba(138, 43, 226, 0.16);
}

:focus-visible {
  outline: 3px solid rgba(138, 43, 226, 0.36);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  left: 16px;
  top: 16px;
  z-index: 100;
  transform: translateY(-140%);
  border-radius: var(--radius);
  background: var(--ink);
  color: #fff;
  padding: 10px 14px;
  font-weight: 800;
  transition: transform 0.2s ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.shell,
.shell-wide,
.shell-narrow {
  width: min(100% - 32px, 1180px);
  margin-inline: auto;
}

.shell-wide {
  width: min(100% - 32px, 1120px);
}

.shell-narrow {
  width: min(100% - 32px, 760px);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid rgba(223, 216, 234, 0.82);
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(18px);
}

.header-inner {
  display: grid;
  min-height: 72px;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 20px;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  gap: 12px;
  color: var(--foreground);
}

.brand-link img {
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  filter: drop-shadow(0 10px 18px rgba(15, 23, 42, 0.12));
}

.brand-link span {
  display: grid;
  gap: 0;
}

.brand-link strong {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.2;
}

.brand-link em {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  border: 1px solid rgba(138, 43, 226, 0.18);
  border-radius: 999px;
  background: rgba(138, 43, 226, 0.1);
  color: var(--primary);
  padding: 2px 8px;
  font-size: 0.66rem;
  font-style: normal;
  font-weight: 900;
  line-height: 1;
}

.brand-link small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.25;
}

.desktop-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 26px;
}

.desktop-nav a,
.mobile-nav a {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

.desktop-nav a:hover,
.mobile-nav a:hover {
  color: var(--foreground);
}

.desktop-nav .nav-current,
.mobile-nav .nav-current {
  color: var(--primary);
}

.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.button,
.text-button,
.icon-button,
.footer-group button {
  border: 0;
  background: transparent;
  color: inherit;
}

.button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  padding: 0 16px;
  font-size: 0.88rem;
  font-weight: 800;
  line-height: 1;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 14px 28px -18px rgba(138, 43, 226, 0.72);
}

.button-primary:hover {
  background: var(--primary-strong);
  color: #fff;
}

.button-secondary {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--foreground);
}

.button-secondary:hover {
  border-color: rgba(138, 43, 226, 0.32);
  color: var(--primary);
}

.text-button {
  color: var(--primary);
  font-size: 0.9rem;
  font-weight: 800;
}

.icon-button {
  display: inline-grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.84);
  color: var(--muted-strong);
}

.icon-button svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.menu-button {
  display: none;
}

.menu-close,
.menu-button.is-open .menu-open {
  display: none;
}

.menu-button.is-open .menu-close {
  display: block;
}

.mobile-nav {
  display: none;
  width: min(100% - 32px, 1180px);
  margin: 0 auto 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
}

.mobile-nav a {
  display: block;
  padding: 13px 14px;
}

.mobile-nav a + a {
  border-top: 1px solid rgba(223, 216, 234, 0.72);
}

.hero-section,
.archive-header {
  padding: 34px 0 18px;
}

.blog-home,
.hero-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.8fr);
  gap: 18px;
  align-items: stretch;
}

.blog-home-copy,
.blog-search-panel,
.hero-copy,
.hero-panel,
.archive-header-inner,
.sidebar-panel,
.cta-panel,
.featured-post,
.post-card {
  border: 1px solid rgba(223, 216, 234, 0.88);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.blog-home-copy,
.hero-copy {
  padding: 30px;
}

.blog-home-copy h1,
.hero-copy h1,
.archive-header h1,
.article-header h1,
.error-screen h1 {
  margin: 0;
  color: var(--foreground);
  font-family: var(--font-heading);
  font-size: 2.65rem;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1.12;
}

.blog-home-copy p,
.hero-copy p,
.archive-header p,
.article-excerpt,
.error-screen p {
  max-width: 760px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.78;
}

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

.eyebrow,
.panel-label {
  margin: 0 0 10px;
  color: var(--primary);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero-panel,
.blog-search-panel,
.sidebar-panel {
  padding: 22px;
}

.blog-search-panel {
  display: grid;
  align-content: start;
  gap: 16px;
}

.blog-search-trigger {
  display: grid;
  width: 100%;
  gap: 4px;
  border: 1px solid rgba(138, 43, 226, 0.22);
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(138, 43, 226, 0.1), rgba(21, 132, 189, 0.08));
  color: var(--foreground);
  padding: 16px;
  text-align: left;
}

.blog-search-trigger span {
  font-weight: 900;
}

.blog-search-trigger small {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.5;
}

.topic-list {
  display: grid;
  gap: 10px;
}

.topic-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid rgba(223, 216, 234, 0.86);
  border-radius: var(--radius);
  background: linear-gradient(135deg, #fff 0%, #f9f6ff 100%);
  padding: 12px;
}

.topic-list span {
  min-width: 0;
  color: var(--foreground);
  font-size: 0.88rem;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.topic-list small {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 700;
}

.section-band {
  padding: 34px 0;
}

.section-band-tight {
  padding-top: 18px;
}

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

.section-heading h2 {
  margin: 0;
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 900;
  line-height: 1.15;
}

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

.content-sidebar {
  position: sticky;
  top: 94px;
  display: grid;
  gap: 16px;
}

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

.post-grid-compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.post-card {
  display: grid;
  min-width: 0;
  overflow: hidden;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.post-card:hover {
  border-color: rgba(138, 43, 226, 0.3);
  box-shadow: 0 22px 46px -34px rgba(49, 42, 60, 0.4);
  transform: translateY(-1px);
}

.post-card-body {
  display: grid;
  gap: 12px;
  padding: 20px;
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
}

.post-meta a {
  color: var(--accent);
}

.post-card h3,
.featured-post h3 {
  margin: 0;
  color: var(--foreground);
  font-family: var(--font-heading);
  font-size: 1.14rem;
  font-weight: 900;
  line-height: 1.28;
}

.post-card p,
.featured-post p,
.cta-panel p,
.footer-brand p {
  margin: 0;
  color: var(--muted);
  line-height: 1.75;
}

.featured-post {
  display: grid;
  overflow: hidden;
}

.featured-body {
  display: flex;
  flex-direction: column;
  align-items: start;
  justify-content: center;
  gap: 16px;
  padding: 26px;
}

.featured-body h3 {
  font-size: 1.55rem;
  line-height: 1.18;
}

.archive-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 34px;
}

.archive-image,
.author-avatar {
  width: 112px;
  height: 112px;
  flex: 0 0 auto;
  border-radius: var(--radius);
}

.author-avatar {
  object-fit: cover;
}

.article {
  padding: 34px 0 0;
}

.article-header {
  text-align: left;
}

.article-header .post-meta {
  justify-content: flex-start;
  margin-bottom: 16px;
}

.article-author {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  margin-top: 22px;
  color: var(--muted-strong);
  font-size: 0.9rem;
  font-weight: 800;
}

.article-layout {
  width: min(100% - 32px, 1260px);
  max-width: 760px;
  padding-top: 30px;
}

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

.gh-content {
  color: #332c3d;
  font-size: 1.06rem;
  line-height: 1.86;
}

.gh-content > *:first-child {
  margin-top: 0;
}

.gh-content > *:last-child {
  margin-bottom: 0;
}

.gh-content p,
.gh-content ul,
.gh-content ol,
.gh-content blockquote,
.gh-content table,
.gh-content pre,
.gh-content figure {
  margin: 0 0 1.45em;
}

.gh-content h2,
.gh-content h3,
.gh-content h4 {
  color: var(--foreground);
  font-family: var(--font-heading);
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1.18;
}

.gh-content h2 {
  margin: 2.2em 0 0.7em;
  font-size: 1.8rem;
}

.gh-content h3 {
  margin: 1.8em 0 0.65em;
  font-size: 1.36rem;
}

.gh-content h4 {
  margin: 1.5em 0 0.6em;
  font-size: 1.1rem;
}

.gh-content a {
  color: var(--primary);
  font-weight: 800;
  text-decoration: underline;
  text-decoration-color: rgba(138, 43, 226, 0.26);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.gh-content strong {
  color: var(--foreground);
  font-weight: 900;
}

.gh-content ul,
.gh-content ol {
  padding-left: 1.3em;
}

.gh-content li + li {
  margin-top: 0.45em;
}

.gh-content blockquote {
  border-left: 4px solid var(--primary);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.64);
  padding: 18px 20px;
  color: var(--muted-strong);
  font-size: 1.12rem;
  font-weight: 700;
}

.gh-content pre {
  overflow-x: auto;
  border-radius: var(--radius);
  background: var(--ink);
  color: #f8fafc;
  padding: 18px;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  line-height: 1.7;
}

.gh-content code {
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.08);
  color: var(--ink);
  padding: 0.15em 0.34em;
  font-family: var(--font-mono);
  font-size: 0.92em;
}

.gh-content pre code {
  background: transparent;
  color: inherit;
  padding: 0;
}

.gh-content table {
  display: block;
  width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
}

.gh-content th,
.gh-content td {
  border: 1px solid var(--border);
  padding: 10px 12px;
  text-align: left;
}

.gh-content th {
  background: rgba(138, 43, 226, 0.08);
  color: var(--foreground);
}

.kg-card,
.kg-image-card,
.kg-gallery-card,
.kg-embed-card,
.kg-bookmark-card {
  margin: 2rem 0;
}

.kg-width-wide {
  width: min(100vw - 32px, 1040px);
  max-width: none;
  margin-left: 50%;
  transform: translateX(-50%);
}

.kg-width-full {
  width: min(100vw, 1440px);
  max-width: none;
  margin-left: 50%;
  transform: translateX(-50%);
}

.kg-width-full img {
  width: 100%;
}

.kg-image,
.kg-gallery-image img,
.kg-card img {
  border-radius: var(--radius);
}

.kg-card figcaption {
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
}

.kg-bookmark-card a.kg-bookmark-container {
  border-color: var(--border);
  border-radius: var(--radius);
}

.article-footer {
  padding: 28px 0 0;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.tag-row a {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  color: var(--muted-strong);
  padding: 8px 12px;
  font-size: 0.78rem;
  font-weight: 800;
}

.cta-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  padding: 24px;
}

.cta-panel > div {
  min-width: 0;
}

.cta-panel h2 {
  max-width: 680px;
  margin: 0 0 8px;
  font-family: var(--font-heading);
  font-size: 1.45rem;
  font-weight: 900;
  line-height: 1.18;
}

.content-sidebar .cta-panel {
  display: grid;
  gap: 16px;
  align-items: start;
  justify-content: stretch;
  padding: 20px;
}

.content-sidebar .cta-panel h2 {
  max-width: none;
  font-size: 1.15rem;
  line-height: 1.28;
}

.content-sidebar .cta-panel p:not(.panel-label) {
  font-size: 0.9rem;
  line-height: 1.65;
}

.content-sidebar .cta-panel .button {
  width: 100%;
  min-height: 40px;
  padding-inline: 14px;
  white-space: nowrap;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 28px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

.pagination a {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  padding: 9px 12px;
  color: var(--foreground);
}

.site-footer {
  margin-top: 42px;
  border-top: 1px solid rgba(223, 216, 234, 0.82);
  background: rgba(255, 255, 255, 0.66);
}

.footer-layout {
  display: grid;
  grid-template-columns: minmax(260px, 1.25fr) repeat(3, minmax(140px, 0.55fr));
  gap: 30px;
  padding: 38px 0 26px;
}

.footer-brand p {
  max-width: 390px;
  margin-top: 16px;
  font-size: 0.92rem;
}

.footer-group {
  display: grid;
  align-content: start;
  gap: 12px;
}

.footer-group h2 {
  margin: 0 0 4px;
  color: var(--foreground);
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.footer-group a,
.footer-group button {
  padding: 0;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
  text-align: left;
}

.footer-group a:hover,
.footer-group button:hover {
  color: var(--primary);
}

.footer-bottom {
  border-top: 1px solid rgba(223, 216, 234, 0.72);
  padding: 18px 0 26px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.back-to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 60;
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  box-shadow: 0 18px 34px -20px rgba(138, 43, 226, 0.7);
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 0.2s ease, transform 0.2s ease, background 0.2s ease;
}

.back-to-top.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.back-to-top:hover {
  background: var(--primary-strong);
}

.back-to-top svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.error-screen {
  display: grid;
  min-height: 54vh;
  align-content: center;
  padding: 76px 0;
}

@media (max-width: 1080px) {
  .desktop-nav {
    gap: 16px;
  }

  .article-layout {
    width: min(100% - 32px, 760px);
  }
}

@media (max-width: 920px) {
  .desktop-nav,
  .header-cta {
    display: none;
  }

  .header-inner {
    grid-template-columns: auto auto;
  }

  .menu-button {
    display: inline-grid;
  }

  .mobile-nav.is-open {
    display: block;
  }

  .blog-home,
  .hero-layout,
  .content-layout,
  .featured-post,
  .footer-layout {
    grid-template-columns: 1fr;
  }

  .content-sidebar {
    position: static;
  }

  .post-grid,
  .post-grid-compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .blog-home-copy h1,
  .hero-copy h1,
  .archive-header h1,
  .article-header h1,
  .error-screen h1 {
    font-size: 2.25rem;
  }

  .featured-body h3 {
    font-size: 1.35rem;
  }

  .archive-header-inner,
  .cta-panel {
    align-items: start;
    flex-direction: column;
  }
}

@media (max-width: 640px) {
  .shell,
  .shell-wide,
  .shell-narrow {
    width: min(100% - 22px, 1180px);
  }

  .site-header {
    position: sticky;
  }

  .header-inner {
    min-height: 64px;
  }

  .brand-link {
    gap: 10px;
  }

  .brand-link img {
    width: 36px;
    height: 36px;
  }

  .brand-link small {
    display: none;
  }

  .brand-link em {
    min-height: 18px;
    padding-inline: 7px;
    font-size: 0.62rem;
  }

  .hero-section,
  .archive-header {
    padding-top: 24px;
  }

  .blog-home-copy,
  .blog-search-panel,
  .hero-copy,
  .archive-header-inner,
  .sidebar-panel,
  .cta-panel {
    padding: 18px;
  }

  .blog-home-copy h1,
  .hero-copy h1,
  .archive-header h1,
  .article-header h1,
  .error-screen h1 {
    font-size: 1.85rem;
    line-height: 1.12;
  }

  .blog-home-copy p,
  .hero-copy p,
  .archive-header p,
  .article-excerpt,
  .error-screen p {
    font-size: 0.96rem;
    line-height: 1.75;
  }

  .hero-actions,
  .section-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .button {
    width: 100%;
  }

  .section-band {
    padding: 24px 0;
  }

  .post-grid,
  .post-grid-compact {
    grid-template-columns: 1fr;
  }

  .post-card-body {
    padding: 16px;
  }

  .article {
    padding-top: 28px;
  }

  .article-layout {
    padding-top: 26px;
  }

  .back-to-top {
    right: 16px;
    bottom: 16px;
    width: 42px;
    height: 42px;
  }

  .article-header {
    text-align: left;
  }

  .article-header .post-meta,
  .article-author {
    justify-content: flex-start;
  }

  .gh-content {
    font-size: 1rem;
    line-height: 1.78;
  }

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

  .gh-content h3 {
    font-size: 1.22rem;
  }

  .footer-layout {
    gap: 22px;
  }
}
