:root {
  /* Font Families */
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, SF Mono, Menlo, Monaco, Consolas, monospace;

  /* Colors - Light Theme Default */
  --bg: #ffffff;
  --text: #1a1a1a;
  --text-muted: #666666;
  --link: #0066cc;
  --link-hover: #004499;
  --border: #e0e0e0;
  --code-bg: #f5f5f5;
  --code-text: #d43f3a;
  --highlight-bg: #fffbdd;
  --badge-bg: #f1f8ff;
  --badge-text: #0366d6;
  --badge-border: #c8e1ff;
}

/* System Dark Theme Override */
@media (prefers-color-scheme: dark) {
  :root:not(.light) {
    --bg: #0f141c;
    --text: #e1e4e8;
    --text-muted: #8b949e;
    --link: #58a6ff;
    --link-hover: #8cc2ff;
    --border: #30363d;
    --code-bg: #161b22;
    --code-text: #ff7b72;
    --highlight-bg: rgba(242, 204, 38, 0.1);
    --badge-bg: rgba(56, 139, 253, 0.1);
    --badge-text: #58a6ff;
    --badge-border: rgba(56, 139, 253, 0.2);
  }
}

/* Explicit Dark Theme Class */
:root.dark {
  --bg: #0f141c;
  --text: #e1e4e8;
  --text-muted: #8b949e;
  --link: #58a6ff;
  --link-hover: #8cc2ff;
  --border: #30363d;
  --code-bg: #161b22;
  --code-text: #ff7b72;
  --highlight-bg: rgba(242, 204, 38, 0.1);
  --badge-bg: rgba(56, 139, 253, 0.1);
  --badge-text: #58a6ff;
  --badge-border: rgba(56, 139, 253, 0.2);
}

/* Explicit Light Theme Class */
:root.light {
  --bg: #ffffff;
  --text: #1a1a1a;
  --text-muted: #666666;
  --link: #0066cc;
  --link-hover: #004499;
  --border: #e0e0e0;
  --code-bg: #f5f5f5;
  --code-text: #d43f3a;
  --highlight-bg: #fffbdd;
  --badge-bg: #f1f8ff;
  --badge-text: #0366d6;
  --badge-border: #c8e1ff;
}


/* Base resets & layout */
* {
  box-sizing: border-box;
}

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-mono);
  line-height: 1.6;
  font-size: 15px;
  max-width: 680px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
}

/* Headers & Navigation */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1rem;
}

.logo {
  font-weight: 700;
  font-size: 1.25rem;
}

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

nav {
  font-size: 0.85rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
}

nav a {
  text-decoration: none;
  color: var(--link);
  padding: 0.1rem 0;
  margin-right: 0.45rem;
  display: inline-flex;
  align-items: center;
}

nav a span {
  border-bottom: 2px solid transparent;
  padding-bottom: 0.1rem;
}

nav a:hover span {
  color: var(--link-hover);
  border-bottom: 2px solid var(--link-hover);
}

nav a.active span {
  color: var(--text);
  font-weight: 500;
  border-bottom: 2px solid var(--text);
}

nav a::after {
  content: "|";
  margin-left: 0.45rem;
  color: var(--border);
  font-weight: normal;
}

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

.meta-hr {
  margin: 1rem 0 2rem 0;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  color: var(--text);
  line-height: 1.3;
  margin-top: 2rem;
  margin-bottom: 1rem;
}

h1 { font-size: 2rem; margin-top: 1rem; }
h2 { font-size: 1.5rem; border-bottom: 1px solid var(--border); padding-bottom: 0.4rem; }
h3 { font-size: 1.2rem; }

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

a:hover {
  text-decoration: underline;
  color: var(--link-hover);
}

p, li {
  margin-bottom: 1rem;
  text-wrap: pretty;
}

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

li {
  margin-bottom: 0.5rem;
}

/* Code & preformatted block settings */
code, pre {
  font-family: var(--font-mono);
}

code {
  font-size: 0.88em;
  background-color: var(--code-bg);
  color: var(--code-text);
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
}

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

pre code {
  background-color: transparent;
  color: var(--text);
  padding: 0;
  border-radius: 0;
  font-size: 0.85rem;
}

/* List index pages (Investigations & Projects) */
.posts-list {
  list-style: none;
  padding-left: 0;
  margin-top: 2rem;
}

.post-item {
  margin-bottom: 2rem;
  border-bottom: 1px dashed var(--border);
  padding-bottom: 1.5rem;
}

.post-item:last-child {
  border-bottom: none;
}

.post-header-line {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.post-title-link {
  font-size: 1.2rem;
  font-weight: 600;
  text-decoration: none;
}

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

.status-badge-inline {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--badge-text);
  background-color: var(--badge-bg);
  border: 1px solid var(--badge-border);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  font-weight: 600;
}

.post-summary-text {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
  margin-bottom: 0;
}

/* Single page posts metadata */
.post-meta {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-bottom: 1.5rem;
}

.meta-item {
  display: flex;
  align-items: center;
}

.meta-item:not(:last-child)::after {
  content: "|";
  margin-left: 0.8rem;
  color: var(--border);
}

/* Footer layout */
footer {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: 3rem;
}

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

footer a:hover {
  color: var(--text);
}

/* General clean lists */
.homepage-actions ul {
  list-style-type: square;
}

/* CSS Styles for headings inside single page templates */
.post-content h3 {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  color: var(--badge-text);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 2rem;
  margin-bottom: 0.8rem;
  border-left: 3px solid var(--badge-text);
  padding-left: 0.5rem;
}

/* Contact methods details */
.contact-grid {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  margin-bottom: 2rem;
}

.contact-item {
  display: flex;
  gap: 1rem;
}

.contact-label {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--text-muted);
  width: 120px;
  flex-shrink: 0;
}

/* Project Metadata Block */
.project-info-grid {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  margin-top: 1rem;
  margin-bottom: 2rem;
  padding: 1.2rem;
  background-color: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
}

.project-info-item {
  display: flex;
  align-items: baseline;
  gap: 1rem;
}

.project-info-label {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-muted);
  width: 160px;
  flex-shrink: 0;
}

.project-info-val {
  font-size: 0.9rem;
}

.nda-badge {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.03em;
}

/* Theme Toggle Button */
.theme-toggle-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.1rem 0.4rem;
  font-size: 0.95rem;
  margin-left: 0.2rem;
  vertical-align: middle;
  border-radius: 4px;
  line-height: 1;
}

.theme-toggle-btn:hover {
  color: var(--text);
  background-color: var(--code-bg);
}

/* Post footer navigation */
.post-footer {
  margin-top: 3rem;
}

.footer-hr {
  border: 0;
  border-top: 1px dashed var(--border);
  margin-bottom: 1.5rem;
}

.back-link {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--link);
  text-decoration: none;
}

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

/* Print Stylesheet */
@media print {
  body {
    background: #ffffff !important;
    color: #000000 !important;
    font-size: 12pt;
    max-width: 100%;
    padding: 0;
    margin: 1.5cm;
  }

  header, footer, hr, .theme-toggle-btn, .homepage-actions, .status-badge-inline, .post-footer {
    display: none !important;
  }

  h1, h2, h3, h4, h5, h6 {
    color: #000000 !important;
    page-break-after: avoid;
  }

  p, li {
    orphans: 3;
    widows: 3;
  }

  pre, code {
    background: #f5f5f5 !important;
    color: #000000 !important;
    border: 1px solid #cccccc !important;
    page-break-inside: avoid;
  }

  a {
    color: #000000 !important;
    text-decoration: underline !important;
  }

  /* Show URLs next to links except internal layout paths */
  a[href^="http"]:after {
    content: " (" attr(href) ")";
    font-size: 90%;
    color: #555555;
  }

  .project-info-grid {
    background: #ffffff !important;
    border: 1px solid #000000 !important;
  }
}



