:root {
  --background: #0e1c23;
  --foreground: #e2e8f0;
  --card: #0e1c23;
  --card-foreground: #e2e8f0;
  --primary: #38bdf8;
  --primary-foreground: #0b1220;
  --secondary: #0e1c23;
  --secondary-foreground: #e2e8f0;
  --muted: #0e1c23;
  --muted-foreground: rgba(226, 232, 240, 0.65);
  --border: rgba(148, 163, 184, 0.2);
  --font-sans: 'JetBrains Mono', 'Roboto Mono', monospace;
  --radius: 0rem;
  --container-max-width: 1200px;
  --content-max-width: 800px;
  --lh-body: 1.5;

  /* Terminal Colors Dark */
  --prompt-user: #34d399;
  --prompt-at: rgba(226, 232, 240, 0.85);
  --prompt-host: #38bdf8;
  --post-link: #67e8f9;
  --post-link-hover: #22d3ee;
  --term-link: #a3e635;
  --code-bg: rgba(15, 23, 42, 0.6);
  --inline-code-bg: rgba(226, 232, 240, 0.12);
}

[data-theme="light"] {
  --background: #ffffff;
  --foreground: #0f172a;
  --card: #ffffff;
  --card-foreground: #0f172a;
  --primary: #e7000b;
  --primary-foreground: #ffffff;
  --secondary: #f8fafc;
  --secondary-foreground: #0f172a;
  --muted: #f1f5f9;
  --muted-foreground: #64748b;
  --border: #e2e8f0;

  /* Terminal Colors Light - Tasks.guru Palette */
  --prompt-user: #020129;
  --prompt-at: #64748b;
  --prompt-host: #e7000b;
  --post-link: #e7000b;
  --post-link-hover: #020129;
  --term-link: #e7000b;
  --code-bg: #f8fafc;
  --inline-code-bg: #f1f5f9;
}

* {
  box-sizing: border-box;
  font-family: var(--font-sans) !important;
}

body {
  background-color: var(--background);
  color: var(--foreground);
  margin: 0;
  padding: 0;
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.3s ease, color 0.3s ease;
}

body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  background-image: radial-gradient(
      circle at 20% 20%,
      rgba(56, 189, 248, 0.06),
      transparent 35%
    ),
    radial-gradient(circle at 80% 0%, rgba(167, 139, 250, 0.06), transparent 40%);
  pointer-events: none;
}

[data-theme="light"] body::before {
  background-image: none;
}

.container {
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

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

a:hover {
  text-decoration: underline;
}

a:focus-visible {
  outline: 1px dashed var(--primary);
  outline-offset: 3px;
}

/* Header & Nav */
.app-header {
  background: var(--background);
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(8px);
}

[data-theme="dark"] .app-header {
  background: rgba(14, 28, 35, 0.92);
}

[data-theme="light"] .app-header {
  background: rgba(255, 255, 255, 0.85);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.main-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.logo {
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  color: var(--foreground);
  letter-spacing: 0.08em;
  text-transform: none;
  white-space: nowrap;
}

[data-theme="light"] .logo {
  font-weight: 800;
}

.logo::before {
  content: "$ ";
  color: var(--primary);
}

.prompt-user {
  color: var(--prompt-user);
}

[data-theme="light"] .prompt-user {
  font-weight: 700;
}

.prompt-at {
  color: var(--prompt-at);
}

.prompt-host {
  color: var(--prompt-host);
}

[data-theme="light"] .prompt-host {
  font-weight: 700;
}

.nav-links {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.nav-link {
  text-decoration: none;
  color: var(--foreground);
  font-weight: 500;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.1rem 0;
  border-bottom: 1px solid transparent;
}

[data-theme="light"] .nav-link {
  color: var(--primary);
  font-weight: 600;
}

.nav-link:hover {
  color: var(--primary);
  border-bottom-color: rgba(56, 189, 248, 0.55);
}

[data-theme="light"] .nav-link:hover {
  color: #020129;
  border-bottom-color: rgba(2, 1, 41, 0.55);
}

.lang-switch {
  display: flex;
  gap: 0.35rem;
  border-left: none;
  padding-left: 0;
  margin-left: 0.75rem;
  position: relative;
}

.theme-toggle {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted-foreground);
  cursor: pointer;
  padding: 0.2rem 0.5rem;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  margin-left: 0.5rem;
}

[data-theme="light"] .theme-toggle {
  color: var(--primary);
  border-color: var(--border);
}

.theme-toggle:hover {
  color: var(--primary);
  border-color: var(--primary);
}

[data-theme="light"] .theme-toggle:hover {
  color: #020129;
  border-color: #020129;
}

[data-theme="dark"] .theme-toggle::after {
  content: "☀";
}

[data-theme="light"] .theme-toggle::after {
  content: "☾";
}

.lang-link {
  text-decoration: none;
  color: var(--muted-foreground);
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.1rem 0.25rem;
  border: 1px solid transparent;
}

[data-theme="light"] .lang-link {
  color: var(--primary);
  font-weight: 600;
}

[data-theme="light"] .lang-link:hover {
  color: #020129;
}

.lang-link.active {
  color: var(--primary);
  background-color: transparent;
  border-color: rgba(56, 189, 248, 0.4);
}

[data-theme="light"] .lang-link.active {
  color: #020129;
  border-color: rgba(2, 1, 41, 0.3);
}

/* Hero Section */
.hero-section {
  padding: 5rem 0;
  text-align: center;
  background-color: transparent;
  border-bottom: 1px solid var(--border);
  margin-bottom: 3rem;
}

.hero-title {
  font-size: clamp(2rem, 5vw, 3.5rem);
  line-height: 1.1;
  font-weight: 800;
  margin-bottom: 1.5rem;
  letter-spacing: -2px;
}

.hero-subtitle {
  font-size: 1.15rem;
  color: var(--muted-foreground);
  max-width: 700px;
  margin: 0 auto 2.5rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 2rem;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.2s ease;
  cursor: pointer;
  border: none;
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 0.5px;
}

.btn-primary {
  background-color: var(--primary);
  color: var(--primary-foreground);
}

.btn-primary:hover {
  filter: brightness(1.2);
}

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

/* How It Works Section */
.section-title {
  font-size: 1.75rem;
  font-weight: 800;
  text-align: center;
  margin-bottom: 3rem;
  letter-spacing: -1px;
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 2rem;
}

.step-card {
  background: white;
  border: 1px solid var(--border);
  padding: 2rem;
}

.step-number {
  width: 2rem;
  height: 2rem;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  margin-bottom: 1rem;
}

.step-title {
  font-size: 1.25rem;
  font-weight: 800;
  margin-bottom: 0.75rem;
}

.step-desc {
  font-size: 0.95rem;
  color: var(--muted-foreground);
}

/* Posts Grid */
.posts-section {
  padding: 5rem 0;
}

.posts-section-home {
  padding-top: 2rem;
}

.posts-list {
  max-width: var(--content-max-width);
  margin: 0 auto;
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  font-family: var(--font-sans) !important;
  font-size: 0.92rem;
  color: var(--foreground);
}

.posts-list-total {
  color: var(--muted-foreground);
  margin-bottom: 0.6rem;
}

.posts-list-row {
  display: grid;
  grid-template-columns: 32px 70px 28px 140px 34px minmax(200px, 1fr);
  column-gap: 0.8rem;
  padding: 0.28rem 0;
  align-items: baseline;
}

.posts-list-num {
  color: var(--muted-foreground);
  text-align: right;
  opacity: 0.5;
  font-size: 0.8rem;
}

.posts-list-row:hover {
  background: rgba(148, 163, 184, 0.1);
}

[data-theme="light"] .posts-list-row:hover {
  background: rgba(14, 165, 233, 0.05);
}

.posts-list-cell {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.posts-list-perms {
  color: #a78bfa;
}

[data-theme="light"] .posts-list-perms {
  color: #7c3aed;
}

.posts-list-acl {
  color: var(--muted-foreground);
  text-align: center;
}

.posts-list-date {
  color: var(--prompt-host);
}

.posts-list-flag {
  color: var(--prompt-user);
  text-align: center;
}

.posts-list-name {
  min-width: 0;
}

.posts-list-tags {
  color: var(--muted-foreground);
  font-size: 0.8rem;
  margin-top: 0.15rem;
}

.posts-list-tags a,
.post-terms {
  color: inherit;
  text-decoration: none;
}

.posts-list-tags a:hover,
.post-terms:hover {
  color: var(--primary);
  text-decoration: underline;
}

.posts-list-link {
  color: var(--post-link);
  text-decoration: none;
}

[data-theme="light"] .posts-list-link {
  font-weight: 600;
}

.posts-list-link:hover {
  color: var(--post-link-hover);
  text-decoration: underline;
}

.frontmatter-tag {
  color: var(--term-link);
  text-decoration: none;
  white-space: nowrap;
}

[data-theme="light"] .frontmatter-tag {
  font-weight: 600;
}

.frontmatter-tag:hover {
  text-decoration: underline;
}

.section-actions {
  text-align: center;
  margin-top: 3rem;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 2.5rem;
  flex-wrap: wrap;
}

.pagination-link {
  text-decoration: none;
  color: var(--foreground);
  border: 1px solid var(--border);
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  font-size: 0.85rem;
}

.pagination-link.is-disabled {
  color: var(--muted-foreground);
  border-color: var(--border);
  cursor: default;
}

.pagination-info {
  color: var(--muted-foreground);
  font-size: 0.85rem;
}

/* Terms (tags) */
.terms-list {
  max-width: var(--content-max-width);
  margin: 0 auto;
  font-family: var(--font-sans) !important;
  font-size: 0.92rem;
}

.terms-total {
  color: var(--muted-foreground);
  margin-bottom: 0.6rem;
}

.terms-row {
  display: grid;
  grid-template-columns: 90px minmax(200px, 1fr);
  column-gap: 1rem;
  padding: 0.28rem 0;
}

.terms-row:hover {
  background: rgba(148, 163, 184, 0.1);
}

.terms-cell {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.terms-count {
  color: var(--muted-foreground);
  text-align: right;
  padding-right: 0.25rem;
}

.terms-link {
  color: var(--term-link);
  text-decoration: none;
}

.terms-link:hover {
  text-decoration: underline;
}

@media (max-width: 640px) {
  .terms-row {
    grid-template-columns: 70px minmax(140px, 1fr);
  }
}

/* Post Content Styling */
.app-main {
  padding: 2rem 0 5rem;
}

/* Terminal-style breadcrumbs to mirror path notation like "./section/page". */
.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.15rem;
  font-size: 0.85rem;
  color: var(--muted-foreground);
  margin: 0 0 1.5rem;
}

.breadcrumbs::before {
  content: "";
  color: var(--muted-foreground);
}

.breadcrumb-link {
  color: var(--post-link);
  text-decoration: none;
}

.breadcrumb-link:hover {
  color: var(--post-link-hover);
  text-decoration: underline;
}

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

.breadcrumb-current {
  color: var(--foreground);
}

.post-full {
  max-width: var(--content-max-width);
  margin: 0 auto;
}

.post-header {
  margin-bottom: 3rem;
  text-align: center;
}

.post-title {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800;
  letter-spacing: -1.5px;
  margin-bottom: 1rem;
}

.post-meta {
  color: var(--muted-foreground);
  font-size: 0.85rem;
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.post-content-header {
  text-align: left;
  margin-bottom: 2rem;
}

.post-content-header .post-title {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: 0;
  margin-bottom: 0.4rem;
}

.post-date {
  color: var(--muted-foreground);
  font-size: 0.85rem;
  display: block;
}

.post-content-header .post-tags {
  margin-top: 0.75rem;
  justify-content: center;
}

.post-frontmatter {
  margin-bottom: 1rem;
}

.frontmatter-line {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: baseline;
  font-size: 1rem;
  color: var(--muted-foreground);
}

.frontmatter-key {
  color: var(--prompt-user);
}

.frontmatter-punct {
  color: var(--muted-foreground);
}

.frontmatter-value {
  color: var(--foreground);
}

h1.frontmatter-value {
  display: inline;
  font-size: inherit;
  font-weight: inherit;
  margin: 0;
  padding: 0;
  color: inherit;
}

.frontmatter-sep {
  opacity: 0.5;
}

.post-content .post-tags {
  justify-content: flex-start;
}

.post-tags-bottom {
  margin-top: 2rem;
}

.post-content {
  font-size: 1rem;
  line-height: 1.7;
  background: transparent;
  color: var(--foreground);
  padding: 2rem 0;
  border: none;
  border-radius: 0;
  font-family: var(--font-sans) !important;
}

.post-content p {
  margin-bottom: 1.5rem;
}

.post-content h2 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4,
.post-content h5,
.post-content h6 {
  color: var(--foreground);
}

.post-content h1::before,
.post-content h2::before,
.post-content h3::before,
.post-content h4::before,
.post-content h5::before,
.post-content h6::before {
  color: var(--muted-foreground);
  opacity: 0.65;
}

.post-content h2::before {
  content: "## ";
}

.post-content h3::before {
  content: "### ";
}

.post-content h4::before {
  content: "#### ";
}

.post-content h5::before {
  content: "##### ";
}

.post-content h6::before {
  content: "###### ";
}

.post-content a {
  color: var(--post-link);
}

.post-content blockquote {
  border-left: 3px solid var(--border);
  padding-left: 1rem;
  color: var(--muted-foreground);
}

.post-content pre,
.post-content code,
.post-content pre code,
.post-content .hljs {
  font-family: var(--font-sans) !important;
}

.post-content pre {
  background: var(--code-bg);
  color: var(--foreground);
  padding: 1.25rem 1.5rem;
  border-radius: 4px;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
  line-height: 1.6;
  box-shadow: none;
  border: 1px solid var(--border);
}

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

.post-content code {
  background: var(--inline-code-bg);
  color: var(--foreground);
  padding: 0.15rem 0.35rem;
  border-radius: 4px;
  font-size: 0.95em;
}

.post-content .hljs {
  background: transparent;
}

.post-content p > img,
.post-content p > a:only-child > img,
.post-content figure > img,
.post-content figure > a:only-child > img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 1.75rem auto;
}

/* Center embedded videos the same way as images (see render-link hook in layouts/_default/_markup/render-link.html). */
.post-content p > video.post-video,
.post-content figure > video.post-video {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 1.75rem auto;
}

.post-content figure {
  margin: 1.75rem auto;
  text-align: center;
}

.post-content figcaption {
  margin-top: 0.5rem;
  color: var(--muted-foreground);
  font-size: 0.85rem;
}

@media (max-width: 900px) {
  .posts-list-row {
    grid-template-columns: 32px 70px 24px 120px 30px minmax(160px, 1fr);
  }
}

@media (max-width: 640px) {
  .posts-list-row {
    grid-template-columns: 1fr;
    row-gap: 0.35rem;
  }
  .posts-list-cell {
    white-space: normal;
  }
}

/* Footer */
.app-footer {
  background: var(--background);
  border-top: 1px solid var(--border);
  padding: 2.5rem 0 1.75rem;
}

[data-theme="dark"] .app-footer {
  background: rgba(14, 28, 35, 0.92);
}

[data-theme="light"] .app-footer {
  background: rgba(245, 245, 245, 0.92);
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 3rem;
  margin-bottom: 3rem;
}

.footer-title {
  font-size: 0.9rem;
  font-weight: 600;
  text-transform: none;
  margin-bottom: 1.5rem;
  color: var(--foreground);
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-links li {
  margin-bottom: 0.5rem;
}

.footer-links a {
  text-decoration: none;
  color: var(--muted-foreground);
  font-size: 0.9rem;
}

.footer-text {
  color: var(--muted-foreground);
  font-size: 0.9rem;
  line-height: 1.6;
  margin: 0;
}

.footer-copyright {
  margin: 0.75rem 0 0;
  color: var(--muted-foreground);
  opacity: 0.8;
  font-size: 0.8rem;
}

@media (max-width: 768px) {
  .main-nav {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
  .nav-links {
    flex-direction: column;
    gap: 0.5rem;
  }
  .lang-switch {
    border-left: none;
    padding-left: 0;
    margin-left: 0;
    margin-top: 0.5rem;
  }
  .post-content {
    padding: 1.5rem;
  }
}

/* ---------------------------------------------------------------------------
 * Accent shildiks (SNITCHMD-style): black bg + white fg in light theme,
 * inverted in dark. Applied to tags, active nav, prompt host, $ prefix.
 * Display headings switch to a heavy sans-serif stack with tight tracking.
 * ------------------------------------------------------------------------- */

:root {
  --accent-bg: #ffffff;
  --accent-fg: #000000;
  --font-display: 'Inter', 'Helvetica Neue', 'Arial Black', system-ui, sans-serif;
}

[data-theme="light"] {
  --accent-bg: #000000;
  --accent-fg: #ffffff;
}

.accent-pill,
.frontmatter-tag,
.terms-link,
.posts-list-tags a,
.post-terms,
.lang-link.active,
.breadcrumb-current {
  background-color: var(--accent-bg) !important;
  color: var(--accent-fg) !important;
  padding: 0.05em 0.4em;
  border: none !important;
  font-weight: 700;
  text-decoration: none;
  border-radius: 2px;
  white-space: nowrap;
}

.frontmatter-tag:hover,
.terms-link:hover,
.posts-list-tags a:hover,
.post-terms:hover,
.lang-link.active:hover,
.breadcrumb-current:hover {
  background-color: var(--accent-bg) !important;
  color: var(--accent-fg) !important;
  text-decoration: underline;
}

/* Logo prompt: black bg pill around `$ user@host`. */
.logo {
  background-color: var(--accent-bg);
  color: var(--accent-fg);
  padding: 0.1em 0.5em;
  border-radius: 2px;
}

.logo::before {
  content: "$ ";
  color: var(--accent-fg);
}

.logo .prompt-user,
.logo .prompt-at,
.logo .prompt-host {
  color: var(--accent-fg) !important;
  font-weight: 700;
}

/* Display headings: heavy condensed sans-serif, tight tracking. */
.hero-title,
.section-title,
.post-title,
.post-content-header .post-title {
  font-family: var(--font-display) !important;
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1.0;
  text-transform: uppercase;
}

.post-content-header .post-title {
  text-transform: none;
  letter-spacing: -0.02em;
}
