/* === SIX VOLTS — Design System === */

:root {
  /* Surface & Background */
  --color-abyss:        #000000;
  --color-iron:         #111111;
  --color-surface:      #181818;
  --color-charcoal:     #202020;
  --color-border:       #2a2a2a;

  /* Text */
  --color-white:        #FFFFFF;
  --color-smoke:        #E0E0E0;
  --color-ash:          #7D7D7D;
  --color-steel:        #969696;

  /* Accent */
  --color-gold:         #FFC000;
  --color-gold-hover:   #D4A000;
  --color-gold-dim:     #917300;
  --color-gold-subtle:  rgba(255, 192, 0, 0.12);

  /* Semantic */
  --color-link:         #FFC000;
  --color-link-hover:   #FFFFFF;
  --color-code-bg:      #151515;

  /* Layout */
  --content-width:      680px;
  --sidebar-width:      280px;
  --site-max-width:     1100px;
  --header-height:      64px;
}

/* === Reset === */

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

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

body {
  background: var(--color-abyss);
  color: var(--color-smoke);
  font-family: 'Barlow', sans-serif;
  font-weight: 400;
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* === Header === */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--color-iron);
  border-bottom: 1px solid var(--color-border);
  height: var(--header-height);
}

.header-inner {
  max-width: var(--site-max-width);
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 600;
  font-size: 24px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-white);
  text-decoration: none;
  line-height: 1;
}

.site-title .gold {
  color: var(--color-gold);
}

.site-nav {
  display: flex;
  gap: 32px;
  align-items: center;
}

.site-nav a {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 500;
  font-size: 14px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--color-ash);
  text-decoration: none;
  line-height: 1;
  transition: color 0.15s;
}

.site-nav a:hover {
  color: var(--color-white);
}

.site-nav a.active {
  color: var(--color-gold);
}

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  flex-direction: column;
  gap: 5px;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-white);
  transition: transform 0.2s, opacity 0.2s;
}

/* === Layouts === */

.index-layout {
  max-width: var(--site-max-width);
  margin: 0 auto;
  padding: 48px 24px;
  display: flex;
  gap: 48px;
  flex: 1;
}

.main-content {
  flex: 1;
  max-width: var(--content-width);
  min-width: 0;
}

.post-layout {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 48px 24px;
  flex: 1;
}

.post-content {
  width: 100%;
}

/* === Sidebar === */

.sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
}

.sidebar-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 500;
  font-size: 13px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--color-gold);
  margin-bottom: 24px;
}

.post-list-item {
  padding: 16px 0;
  border-bottom: 1px solid var(--color-border);
}

.post-list-item a {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 500;
  font-size: 16px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--color-white);
  text-decoration: none;
  display: block;
  transition: color 0.15s;
}

.post-list-item a:hover {
  color: var(--color-gold);
}

.post-list-item.current a {
  color: var(--color-gold);
}

.post-list-item time {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-ash);
  display: block;
  margin-top: 4px;
}

/* === Post Header === */

.post-header {
  margin-bottom: 32px;
}

.post-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 600;
  font-size: 40px;
  line-height: 1.05;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-white);
  margin-bottom: 16px;
}

.post-title a {
  color: inherit;
  text-decoration: none;
}

.post-title a:hover {
  color: var(--color-gold);
}

.post-meta {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 500;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-ash);
  line-height: 1.4;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.post-meta .sep {
  color: var(--color-border);
}

/* === Post Body (Markdown Content) === */

.post-body p {
  margin-bottom: 1.5em;
}

.post-body h2 {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 500;
  font-size: 28px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--color-white);
  margin-top: 2.5em;
  margin-bottom: 0.75em;
  padding-top: 2em;
  border-top: 1px solid var(--color-border);
  line-height: 1.15;
}

.post-body h3 {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 500;
  font-size: 22px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--color-white);
  margin-top: 2em;
  margin-bottom: 0.5em;
  line-height: 1.2;
}

.post-body h4 {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 500;
  font-size: 18px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--color-smoke);
  margin-top: 1.5em;
  margin-bottom: 0.5em;
  line-height: 1.3;
}

.post-body a {
  color: var(--color-link);
  text-decoration: none;
  transition: color 0.15s;
}

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

.post-body strong {
  font-weight: 600;
  color: var(--color-white);
}

.post-body em {
  font-style: italic;
}

.post-body blockquote {
  border-left: 3px solid var(--color-gold);
  padding-left: 24px;
  color: var(--color-ash);
  font-style: italic;
  background: var(--color-gold-subtle);
  padding: 16px 24px;
  margin-bottom: 1.5em;
}

.post-body code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 15px;
  background: var(--color-code-bg);
  padding: 2px 6px;
  border-radius: 2px;
  color: var(--color-gold);
}

.post-body pre {
  background: var(--color-surface);
  padding: 24px;
  border-left: 3px solid var(--color-gold-dim);
  overflow-x: auto;
  margin-bottom: 1.5em;
}

.post-body pre code {
  background: none;
  padding: 0;
  border-radius: 0;
  color: var(--color-smoke);
  font-size: 15px;
  line-height: 1.6;
}

.post-body ul,
.post-body ol {
  margin-left: 1.5em;
  margin-bottom: 1.5em;
}

.post-body li {
  margin-bottom: 0.5em;
  line-height: 1.7;
}

.post-body li::marker {
  color: var(--color-ash);
}

.post-body hr {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 3em 0;
}

.post-body table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5em;
}

.post-body thead th {
  background: var(--color-surface);
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 500;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-white);
  text-align: left;
  padding: 12px;
}

.post-body td {
  padding: 12px;
  border-bottom: 1px solid var(--color-border);
  font-size: 15px;
}

.post-body img {
  max-width: 100%;
  border: 1px solid var(--color-border);
}

/* === Tags === */

.tag {
  display: inline-block;
  background: var(--color-charcoal);
  color: var(--color-ash);
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 10px;
  line-height: 1;
}

/* === Post Nav === */

.post-nav {
  margin-top: 32px;
}

.back-link {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 500;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-ash);
  text-decoration: none;
  transition: color 0.15s;
}

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

/* === Footer === */

.site-footer {
  background: var(--color-iron);
  border-top: 1px solid var(--color-border);
  padding: 32px;
  text-align: center;
}

.footer-inner p {
  font-size: 13px;
  color: var(--color-ash);
  margin-bottom: 12px;
}

.footer-nav {
  display: flex;
  justify-content: center;
  gap: 24px;
}

.footer-nav a {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 500;
  font-size: 14px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--color-ash);
  text-decoration: none;
  transition: color 0.15s;
}

.footer-nav a:hover {
  color: var(--color-white);
}

/* === Syntax Highlighting (Monokai adapted) === */

.highlight          { background: var(--color-surface); }
.highlight pre      { margin: 0; }
.highlight .c       { color: #7D7D7D; font-style: italic; }  /* Comments */
.highlight .c1      { color: #7D7D7D; font-style: italic; }
.highlight .cm      { color: #7D7D7D; font-style: italic; }
.highlight .cp      { color: #7D7D7D; font-style: italic; }
.highlight .cs      { color: #7D7D7D; font-style: italic; }
.highlight .k       { color: #FFC000; }                       /* Keywords */
.highlight .kc      { color: #FFC000; }
.highlight .kd      { color: #FFC000; }
.highlight .kn      { color: #FFC000; }
.highlight .kp      { color: #FFC000; }
.highlight .kr      { color: #FFC000; }
.highlight .kt      { color: #FFC000; }
.highlight .s       { color: #E6DB74; }                       /* Strings */
.highlight .s1      { color: #E6DB74; }
.highlight .s2      { color: #E6DB74; }
.highlight .sa      { color: #E6DB74; }
.highlight .sb      { color: #E6DB74; }
.highlight .sc      { color: #E6DB74; }
.highlight .sd      { color: #E6DB74; font-style: italic; }
.highlight .se      { color: #E6DB74; }
.highlight .sh      { color: #E6DB74; }
.highlight .si      { color: #E6DB74; }
.highlight .sr      { color: #E6DB74; }
.highlight .ss      { color: #E6DB74; }
.highlight .sx      { color: #E6DB74; }
.highlight .n       { color: #E0E0E0; }                       /* Names */
.highlight .na      { color: #E0E0E0; }
.highlight .nb      { color: #E0E0E0; }
.highlight .nc      { color: #FFFFFF; }
.highlight .nd      { color: #FFC000; }
.highlight .ne      { color: #FFFFFF; }
.highlight .ni      { color: #E0E0E0; }
.highlight .nl      { color: #E0E0E0; }
.highlight .nn      { color: #E0E0E0; }
.highlight .no      { color: #FFC000; }
.highlight .nt      { color: #FFC000; }
.highlight .nv      { color: #E0E0E0; }
.highlight .o       { color: #969696; }                       /* Operators */
.highlight .ow      { color: #FFC000; }
.highlight .p       { color: #E0E0E0; }                       /* Punctuation */
.highlight .nf      { color: #FFFFFF; }                       /* Function names */
.highlight .fm      { color: #FFFFFF; }
.highlight .mi      { color: #29ABE2; }                       /* Numbers */
.highlight .mf      { color: #29ABE2; }
.highlight .mh      { color: #29ABE2; }
.highlight .mo      { color: #29ABE2; }
.highlight .il      { color: #29ABE2; }
.highlight .bp      { color: #E0E0E0; }
.highlight .w       { color: #E0E0E0; }
.highlight .err     { color: #E0E0E0; }
.highlight .ge      { font-style: italic; }
.highlight .gs      { font-weight: 600; }
.highlight .gh      { color: #FFFFFF; }
.highlight .gi      { color: #A6E22E; }
.highlight .gd      { color: #F92672; }
.highlight .gp      { color: #7D7D7D; }
.highlight .go      { color: #7D7D7D; }
.highlight .gt      { color: #7D7D7D; }
.highlight .gu      { color: #7D7D7D; font-weight: 600; }

/* codehilite wraps in a div.highlight > pre > span */
.highlight pre,
.codehilite pre {
  background: var(--color-surface);
  padding: 24px;
  border-left: 3px solid var(--color-gold-dim);
  overflow-x: auto;
  font-family: 'JetBrains Mono', monospace;
  font-size: 15px;
  line-height: 1.6;
}

.codehilite {
  margin-bottom: 1.5em;
}

/* Ensure code inside highlight blocks doesn't get inline code styling */
.highlight code,
.codehilite code {
  background: none;
  padding: 0;
  border-radius: 0;
  color: inherit;
}

/* === Copy Button on Code Blocks === */

.code-wrapper {
  position: relative;
}

.copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: var(--color-charcoal);
  color: var(--color-ash);
  border: 1px solid var(--color-border);
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 10px;
  cursor: pointer;
  line-height: 1;
  opacity: 0;
  transition: opacity 0.15s, color 0.15s;
}

.code-wrapper:hover .copy-btn {
  opacity: 1;
}

.copy-btn:hover {
  color: var(--color-white);
}

.copy-btn.copied {
  color: var(--color-gold);
}

/* === Mobile Nav Overlay === */

.nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--color-iron);
  z-index: 99;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.nav-overlay.open {
  display: flex;
}

.nav-overlay a {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 500;
  font-size: 24px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--color-ash);
  text-decoration: none;
  padding: 12px;
  min-height: 48px;
  display: flex;
  align-items: center;
}

.nav-overlay a:hover,
.nav-overlay a.active {
  color: var(--color-gold);
}

/* === Responsive === */

@media (max-width: 768px) {
  .site-nav {
    display: none;
  }

  .nav-toggle {
    display: flex;
  }

  .index-layout {
    flex-direction: column;
    padding: 32px 16px;
    gap: 32px;
  }

  .sidebar {
    width: 100%;
  }

  .post-layout {
    padding: 32px 16px;
  }

  .post-title {
    font-size: 28px;
  }

  .site-title {
    font-size: 20px;
  }
}
