:root {
  --bg: #201547;
  --bg-light: #2E1F5E;
  --bg-lighter: #3A2B70;
  --text: #FFFFFF;
  --text-muted: #CCCCCC;
  --text-dim: #999999;
  --border: #2E1F5E;
  --code-bg: #2A1B52;
  --sidebar-width: 220px;
  --content-max: 800px;
  --font: "SF Mono", "Fira Code", "JetBrains Mono", "Cascadia Code", "Consolas", monospace;
}

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  border-radius: 0 !important;
  box-shadow: none !important;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
}

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

a:hover {
  text-decoration: underline;
}

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

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background: var(--bg-lighter);
}

/* ---- Site Wrapper ---- */

.site-wrapper {
  max-width: calc(var(--sidebar-width) + var(--content-max));
  margin: 0 auto;
  display: flex;
  min-height: 100vh;
}

/* ---- Sidebar ---- */

.sidebar {
  position: sticky;
  top: 0;
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  height: 100vh;
  background: var(--bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 2rem 0;
  z-index: 100;
}

.sidebar-header {
  padding: 0 1.5rem 2rem;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.sidebar-logo:hover {
  text-decoration: none;
}

.sidebar-logo-img {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}

.sidebar-links {
  list-style: none;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 1.5rem;
  color: var(--text-muted);
  font-size: 0.875rem;
  border-left: 3px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}

.sidebar-link:hover {
  color: var(--text);
  text-decoration: none;
}

.sidebar-link.active {
  color: var(--text);
  border-left-color: var(--text);
  font-weight: 700;
}

.sidebar-link svg {
  flex-shrink: 0;
}

/* ---- Menu Toggle (Mobile) ---- */

.menu-toggle {
  display: none;
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 200;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.5rem;
  cursor: pointer;
  line-height: 0;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 90;
}

/* ---- Main Content ---- */

.main-content {
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.page-content,
.post-content,
.home-content {
  max-width: var(--content-max);
  padding: 3rem 2rem;
  flex: 1;
}

/* ---- Typography ---- */

h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 1rem;
}

h1 { font-size: 1.75rem; margin-bottom: 1.5rem; }
h2 { font-size: 1.35rem; margin-top: 2.5rem; }
h3 { font-size: 1.1rem; margin-top: 2rem; }

p {
  margin-bottom: 1rem;
}

ul, ol {
  margin-bottom: 1rem;
  padding-left: 1.5rem;
}

li {
  margin-bottom: 0.35rem;
}

code {
  font-family: var(--font);
  background: var(--code-bg);
  padding: 0.15em 0.4em;
  font-size: 0.9em;
}

pre {
  background: var(--code-bg);
  padding: 1rem;
  overflow-x: auto;
  margin-bottom: 1rem;
  border: 1px solid var(--border);
}

pre code {
  background: none;
  padding: 0;
}

hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2rem 0;
}

blockquote {
  border-left: 3px solid var(--bg-lighter);
  padding-left: 1rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

/* ---- Home Page ---- */

.hero {
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 3rem;
}

.hero-heading {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.hero-logo {
  height: 5rem;
  width: auto;
  flex-shrink: 0;
  padding-right: 0.5rem;
}

.hero-heading-text {
  display: flex;
  flex-direction: column;
}

.hero-title {
  font-size: 2.25rem;
  margin-bottom: 0;
}

.hero-tagline {
  font-size: 1.1rem;
  color: var(--text-muted);
  margin-bottom: 0;
}

.hero-description {
  font-size: 0.95rem;
  color: var(--text-muted);
  max-width: 600px;
}

.screenshot-placeholder {
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  font-size: 0.85rem;
  margin: 2rem 0;
  background: var(--code-bg);
}

.screenshot-placeholder--hero {
  width: 100%;
  aspect-ratio: 16 / 10;
  max-width: 600px;
}

.screenshot-placeholder--inline {
  width: 100%;
  aspect-ratio: 4 / 3;
  max-width: 500px;
  margin: 1.5rem 0;
}

.home-section {
  margin-bottom: 3rem;
}

.home-section h2 {
  margin-top: 0;
  margin-bottom: 0.5rem;
}

.home-section > p {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
}

.home-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
}

.home-grid-item {
  background: var(--bg);
  padding: 1.25rem;
}

.home-grid-item a {
  display: block;
}

.home-grid-item a:hover {
  text-decoration: none;
}

.home-grid-item a:hover .home-grid-title {
  text-decoration: underline;
}

.home-grid-title {
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 0.35rem;
}

.home-grid-excerpt {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.home-grid-image {
  width: 100%;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 1.25rem;
}

.home-grid-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.home-grid-item--feature a {
  display: flex;
  flex-direction: column;
}

.home-grid-item--feature .home-grid-title,
.home-grid-item--feature .home-grid-excerpt {
  padding: 0 1.25rem;
}

.home-grid-item--feature .home-grid-title {

}

.home-grid-item--feature .home-grid-excerpt {
  padding-bottom: 1rem;
}

.home-grid-item--feature {
  padding: 0;
  border: 1px solid var(--border);
}

/* ---- Article List (Category Pages) ---- */

.page-description {
  color: var(--text-muted);
  margin-bottom: 2rem;
  font-size: 0.95rem;
}

.article-list {
  list-style: none;
  padding: 0;
  border-top: 1px solid var(--border);
}

.article-item {
  border-bottom: 1px solid var(--border);
  margin-bottom: 0;
}

.article-link {
  display: block;
  padding: 1.25rem 0;
}

.article-link:hover {
  text-decoration: none;
}

.article-link:hover .article-title {
  text-decoration: underline;
}

.article-title {
  display: block;
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

.article-excerpt {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ---- Post Content ---- */

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
}

.back-link:hover {
  color: var(--text);
}

.post-content h1 {
  margin-bottom: 2rem;
}

/* ---- Downloads ---- */

.download-list {
  list-style: none;
  padding: 0;
  border-top: 1px solid var(--border);
}

.download-item {
  border-bottom: 1px solid var(--border);
  padding: 1.25rem 0;
}

.download-name {
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 0.35rem;
}

.download-description {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.download-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  border: 1px solid var(--border);
  padding: 0.4rem 0.85rem;
  color: var(--text);
}

.download-link:hover {
  background: var(--bg-light);
  text-decoration: none;
}

/* ---- Footer ---- */

.site-footer {
  padding: 2rem;
  border-top: 1px solid var(--border);
  margin-top: auto;
  font-size: 0.8rem;
  color: var(--text-dim);
}

.site-footer a {
  color: var(--text-muted);
}

/* ---- Responsive ---- */

@media (min-width: 768px) {
  .home-grid {
    grid-template-columns: 1fr 1fr;
  }

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

@media (max-width: 767px) {
  .site-wrapper {
    display: block;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    border-right: none;
  }

  .sidebar.open {
    transform: translateX(0);
    border-right: 1px solid var(--border);
  }

  .sidebar-overlay.open {
    display: block;
  }

  .menu-toggle {
    display: block;
  }

  .page-content,
  .post-content,
  .home-content {
    padding: 4rem 1.25rem 2rem;
  }

  .hero-title {
    font-size: 1.75rem;
  }

  h1 {
    font-size: 1.5rem;
  }
}
