/* ============================================
   RES FUTURAS — Minimal Blog Theme
   ============================================ */

/* === CSS CUSTOM PROPERTIES === */
:root {
  --bg:            #06060a;
  --bg-code:       #0a0a0f;
  --text:          #c2c2ca;
  --text-h1:       #fff;
  --text-h2:       #e8e8ec;
  --text-h3:       #d8d8dc;
  --text-h4:       #c8c8cc;
  --text-strong:   #ddd;
  --text-em:       #999;
  --text-code:     #c8c8d0;
  --text-quote:    #888;
  --text-muted:    #333;
  --text-faint:    #222;
  --nav:           #555;
  --nav-hover:     #ccc;
  --link:          rgba(120, 140, 255, .85);
  --link-underline:       rgba(120, 140, 255, .25);
  --link-underline-hover: rgba(120, 140, 255, .6);
  --border:        rgba(255, 255, 255, .04);
  --border-hard:   #1a1a1f;
  --code-bg:       rgba(255, 255, 255, .04);
  --code-border:   rgba(255, 255, 255, .06);
  --selection:     rgba(50, 80, 255, .25);
  --pagination:    #444;
  --pagination-hover:   #999;
  --pagination-active:  #ccc;
  --logo-opacity:  0.6;
}

[data-theme="light"] {
  --bg:            #f5f5f7;
  --bg-code:       #eaeaef;
  --text:          #3a3a42;
  --text-h1:       #111;
  --text-h2:       #1a1a22;
  --text-h3:       #2a2a32;
  --text-h4:       #3a3a42;
  --text-strong:   #222;
  --text-em:       #666;
  --text-code:     #444;
  --text-quote:    #666;
  --text-muted:    #aaa;
  --text-faint:    #bbb;
  --nav:           #888;
  --nav-hover:     #333;
  --link:          rgba(50, 70, 200, .9);
  --link-underline:       rgba(50, 70, 200, .3);
  --link-underline-hover: rgba(50, 70, 200, .6);
  --border:        rgba(0, 0, 0, .08);
  --border-hard:   #ddd;
  --code-bg:       rgba(0, 0, 0, .04);
  --code-border:   rgba(0, 0, 0, .08);
  --selection:     rgba(50, 80, 255, .2);
  --pagination:    #999;
  --pagination-hover:   #333;
  --pagination-active:  #111;
  --logo-opacity:  1;
}

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

/* === BASE === */
html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color .3s, color .3s;
}

::selection {
  background: var(--selection);
  color: var(--text-h1);
}

main { flex: 1; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; }

/* === LAYOUT === */
.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 24px;
}

/* === MOBILE HEADER === */
.mobile-header {
  display: none;
  border-bottom: 1px solid var(--border);
  transition: border-color .3s;
}

.mobile-header-inner {
  max-width: 800px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mobile-wordmark {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-h1);
  letter-spacing: -0.3px;
  text-decoration: none;
  transition: color .3s;
}

.mobile-nav {
  display: flex;
  gap: 20px;
  align-items: center;
}

.mobile-nav a {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--nav);
  transition: color .2s;
}

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

/* === SIDEBAR === */
.site-sidebar {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: calc((100vw - 800px) / 2);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  padding-top: 80px;
  padding-right: 48px;
  gap: 32px;
  z-index: 10;
  opacity: 1;
  transition: opacity .3s;
}

.site-sidebar:hover {
  opacity: 1;
}

.sidebar-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  transition: opacity .2s;
  width: 90px;
}

.sidebar-brand svg {
  padding: 0 2px;
}

.sidebar-brand polygon {
  fill-opacity: var(--logo-opacity);
  transition: fill-opacity .3s;
}

.sidebar-wordmark {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-h1);
  letter-spacing: 1px;
  width: 100%;
  text-align: center;
  transition: color 1s;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  align-items: center;
  align-self: flex-end;
  width: 90px;
}

.sidebar-nav a {
  display: block;
  width: 100%;
  text-align: center;
  padding: 6px 0;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--nav);
  transition: color .2s;
}

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

.sidebar-nav a.active {
  color: var(--nav-hover);
}

/* === THEME TOGGLE === */
.theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--nav);
  padding: 6px 0;
  transition: color .2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.theme-toggle .icon-moon {
  display: none;
}

[data-theme="light"] .theme-toggle .icon-sun {
  display: none;
}

[data-theme="light"] .theme-toggle .icon-moon {
  display: block;
}

.sidebar-toggle {
  align-self: flex-end;
  width: 90px;
  justify-content: center;
}

/* === POST LIST === */
.home-archive {
  padding-top: 16px;
  margin-bottom: 48px;
  border-top: 1px solid var(--border);
  transition: border-color .3s;
}

.post-list {
  display: flex;
  flex-direction: column;
}

.post-item {
  border-bottom: 1px solid var(--border);
  transition: border-color .3s;
}

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

.post-link {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  padding: 20px 0;
  transition: opacity .2s;
}

.post-link:hover { opacity: .6; }

.post-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 17px;
  font-weight: 500;
  color: var(--text-h2);
  letter-spacing: -0.2px;
  line-height: 1.4;
  transition: color .3s;
}

.post-link time {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  white-space: nowrap;
  flex-shrink: 0;
  transition: color .3s;
}

/* === LIST PAGE === */
.list-header {
  padding-top: 56px;
  margin-bottom: 8px;
}

.list-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 28px;
  font-weight: 700;
  color: var(--text-h1);
  letter-spacing: -0.5px;
  transition: color .3s;
}

/* === ARTICLE (Single Post) === */
.article {
  padding-top: 56px;
  padding-bottom: 80px;
}

/* === MORE POSTS === */
.more-posts {
  padding-bottom: 64px;
}

.more-posts-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-muted);
  padding-top: 32px;
  margin-bottom: 8px;
  transition: color .3s;
}

.article-header {
  margin-bottom: 12px;
}

.article-date {
  display: block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 12px;
  transition: color .3s;
}

.article-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 36px;
  font-weight: 700;
  color: var(--text-h1);
  letter-spacing: -1px;
  line-height: 1.15;
  transition: color .3s;
}

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

.article-title a:hover {
  opacity: .7;
}

/* === ARTICLE CONTENT === */
.article-content {
  font-size: 16px;
  line-height: 1.8;
  color: var(--text);
  transition: color .3s;
}

.article-content h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 24px;
  font-weight: 600;
  color: var(--text-h2);
  letter-spacing: -0.5px;
  margin-top: 48px;
  margin-bottom: 16px;
  line-height: 1.3;
}

.article-content h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 20px;
  font-weight: 600;
  color: var(--text-h3);
  letter-spacing: -0.3px;
  margin-top: 36px;
  margin-bottom: 12px;
  line-height: 1.3;
}

.article-content h4 {
  font-family: 'Inter', sans-serif;
  font-size: 17px;
  font-weight: 600;
  color: var(--text-h4);
  margin-top: 28px;
  margin-bottom: 10px;
}

.article-content p {
  margin-bottom: 20px;
}

.article-content a {
  color: var(--link);
  text-decoration: underline;
  text-decoration-color: var(--link-underline);
  text-underline-offset: 3px;
  transition: text-decoration-color .2s, color .3s;
}

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

.article-content strong {
  color: var(--text-strong);
  font-weight: 600;
}

.article-content em {
  color: var(--text-em);
}

.article-content blockquote {
  border-left: 2px solid var(--border-hard);
  padding: 4px 0 4px 20px;
  margin: 28px 0;
  color: var(--text-quote);
  font-style: italic;
  transition: border-color .3s, color .3s;
}

.article-content blockquote p:last-child {
  margin-bottom: 0;
}

.article-content ul,
.article-content ol {
  padding-left: 24px;
  margin-bottom: 20px;
}

.article-content li {
  margin-bottom: 6px;
}

.article-content li::marker {
  color: var(--text-muted);
}

.article-content hr {
  border: none;
  height: 1px;
  background: var(--code-border);
  margin: 40px 0;
  transition: background-color .3s;
}

/* Inline code */
.article-content code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.875em;
  background: var(--code-bg);
  border: 1px solid var(--code-border);
  border-radius: 3px;
  padding: 2px 6px;
  color: var(--text-code);
  transition: background-color .3s, border-color .3s, color .3s;
}

/* Code blocks */
.article-content pre {
  background: var(--bg-code);
  border: 1px solid var(--border-hard);
  border-radius: 6px;
  padding: 20px 24px;
  margin: 28px 0;
  overflow-x: auto;
  line-height: 1.6;
  transition: background-color .3s, border-color .3s;
}

.article-content pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: 13px;
  color: var(--text);
  border-radius: 0;
}

.highlight { margin: 28px 0; }
.highlight pre { margin: 0; }
.article-content .highlight + .highlight { margin-top: -14px; }

.article-content img {
  border-radius: 6px;
  border: 1px solid var(--border-hard);
  margin: 28px 0;
}

.article-content h2:first-child {
  margin-top: 0;
}

/* === SITE FOOTER === */
.site-footer {
  margin-top: auto;
}

.footer-inner {
  max-width: 800px;
  margin: 0 auto;
  padding: 24px 24px 40px;
  border-top: 1px solid var(--border);
  transition: border-color .3s;
}

.footer-text {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--text-faint);
  letter-spacing: 1px;
  text-transform: uppercase;
  transition: color .3s;
}

/* === PAGINATION === */
.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 40px;
  padding: 24px 0;
  list-style: none;
}

.pagination .page-item a,
.pagination .page-item span {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--pagination);
  padding: 6px 10px;
  transition: color .2s;
}

.pagination .page-item a:hover { color: var(--pagination-hover); }
.pagination .page-item.active span { color: var(--pagination-active); }

/* === RESPONSIVE === */
@media (max-width: 1200px) {
  .site-sidebar {
    display: none;
  }

  .mobile-header {
    display: block;
  }
}

@media (max-width: 640px) {
  .mobile-header-inner {
    padding: 14px 16px;
  }

  .mobile-wordmark {
    font-size: 13px;
  }

  .container {
    padding: 0 16px;
  }

  .article-title {
    font-size: 28px;
    letter-spacing: -0.5px;
  }

  .article-content h2 {
    font-size: 21px;
  }

  .article-content pre {
    padding: 16px;
    border-radius: 0;
    margin-left: -16px;
    margin-right: -16px;
    border-left: none;
    border-right: none;
  }

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

  .post-link {
    flex-direction: column;
    gap: 4px;
  }

  .list-title {
    font-size: 24px;
  }
}
