/* ============================================
   ROOT MINDSET — Digital Brutalism Theme
   ============================================ */

/* --- Fonts --- */
@font-face {
  font-family: 'JetBrains Mono';
  src: url('/fonts/JetBrainsMono-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'JetBrains Mono';
  src: url('/fonts/JetBrainsMono-Bold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* --- Reset & Base --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #0D1117;
  --bg-surface: #161B22;
  --text: #D4D4D4;
  --text-muted: #8B949E;
  --heading: #FFFFFF;
  --accent: #58A6FF;
  --accent-strong: #0066FF;
  --border: #30363D;
  --font-mono: 'JetBrains Mono', 'Cascadia Code', 'Fira Code', monospace;
  --max-width: 70ch;
  --line-height: 1.7;
}

html {
  font-size: 18px;
  scroll-behavior: smooth;
  scrollbar-color: var(--accent-strong) var(--bg-surface);
  scrollbar-width: thin;
}

body {
  font-family: var(--font-mono);
  background-color: var(--bg);
  color: var(--text);
  line-height: var(--line-height);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background-color: var(--accent);
  color: var(--bg);
}

::-webkit-scrollbar {
  width: 8px;
}

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

::-webkit-scrollbar-thumb {
  background: var(--accent-strong);
  border-radius: 0;
}

/* --- Focus --- */
*:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* --- Links --- */
a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover {
  text-decoration: underline;
}

/* --- Layout --- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

main {
  flex: 1;
  padding: 2rem 0;
}

/* --- Header / Navigation --- */
.site-header {
  border-bottom: 2px solid var(--accent-strong);
  padding: 1.25rem 0;
}

.site-header .container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.site-logo {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--heading);
  text-decoration: none;
}

.site-logo:hover {
  text-decoration: none;
  color: var(--accent);
}

.site-logo .prompt {
  color: var(--accent);
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  list-style: none;
}

.site-nav a {
  color: var(--text-muted);
  font-size: 0.85rem;
  padding: 0.25rem 0.5rem;
}

.site-nav a::before {
  content: '/';
  color: var(--accent-strong);
  margin-right: 0.1rem;
}

.site-nav a:hover,
.site-nav a.active {
  color: var(--accent);
  text-decoration: none;
}

/* --- Headings --- */
h1, h2, h3, h4, h5, h6 {
  color: var(--heading);
  font-weight: 700;
  line-height: 1.3;
  margin-top: 2rem;
  margin-bottom: 1rem;
}

h1 { font-size: 1.8rem; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.15rem; }
h4 { font-size: 1rem; }

h2::before {
  content: '## ';
  color: var(--accent);
}

h3::before {
  content: '### ';
  color: var(--accent);
}

/* --- Paragraphs & Content --- */
p {
  margin-bottom: 1.25rem;
}

strong {
  color: var(--heading);
  font-weight: 700;
}

em {
  font-style: italic;
}

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

/* --- Lists --- */
ul, ol {
  margin-bottom: 1.25rem;
  padding-left: 1.5rem;
}

li {
  margin-bottom: 0.35rem;
}

li::marker {
  color: var(--accent);
}

/* --- Blockquotes --- */
blockquote {
  border-left: 3px solid var(--accent-strong);
  padding: 0.75rem 1.25rem;
  margin: 1.5rem 0;
  background-color: var(--bg-surface);
  color: var(--text-muted);
  position: relative;
}

blockquote::before {
  content: '> ';
  color: var(--accent);
  font-weight: 700;
}

blockquote p {
  display: inline;
  margin-bottom: 0;
}

/* --- Code --- */
code {
  font-family: var(--font-mono);
  background-color: var(--bg-surface);
  padding: 0.15rem 0.4rem;
  font-size: 0.9em;
  color: var(--accent);
}

pre {
  background-color: var(--bg-surface);
  border-left: 3px solid var(--accent);
  padding: 1.25rem;
  margin: 1.5rem 0;
  overflow-x: auto;
  font-size: 0.85rem;
  line-height: 1.5;
}

pre code {
  background: none;
  padding: 0;
  color: var(--text);
}

/* --- Images --- */
img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 1.5rem 0;
}

figure {
  margin: 1.5rem 0;
}

figcaption {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-top: 0.5rem;
}

/* --- Tables --- */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.9rem;
}

th, td {
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--border);
  text-align: left;
}

th {
  background-color: var(--bg-surface);
  color: var(--heading);
  font-weight: 700;
}

/* ============================================
   Page Components
   ============================================ */

/* --- Breadcrumb --- */
.breadcrumb {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.breadcrumb .prompt {
  color: var(--accent);
  font-weight: 700;
}

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

.breadcrumb a:hover {
  color: var(--accent);
}

.breadcrumb .separator {
  margin: 0 0.3rem;
  color: var(--border);
}

/* --- Post Meta --- */
.post-meta {
  border-left: 3px solid var(--accent-strong);
  padding: 0.5rem 1rem;
  margin-bottom: 2rem;
  color: var(--text-muted);
  font-size: 0.8rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
}

.post-meta .meta-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.post-meta .meta-label {
  color: var(--accent);
}

/* --- Post Title --- */
.post-title {
  font-size: 2rem;
  margin-top: 0;
  margin-bottom: 1rem;
}

.post-title::before {
  content: none;
}

/* --- Article Content --- */
.article-content {
  margin-bottom: 3rem;
}

/* --- Tags & Pillars (Badges) --- */
.badge {
  display: inline-block;
  border: 1px solid var(--accent-strong);
  color: var(--accent);
  padding: 0.15rem 0.5rem;
  font-size: 0.75rem;
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.badge:hover {
  background-color: var(--accent-strong);
  color: var(--heading);
  text-decoration: none;
}

.badge-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

/* --- Terminal Section Headers --- */
.terminal-header {
  font-size: 1.4rem;
  color: var(--heading);
  margin-bottom: 1.5rem;
  font-weight: 700;
}

.terminal-header .cmd {
  color: var(--accent);
}

.terminal-header .path {
  color: var(--text);
}

/* --- Post List --- */
.post-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.post-list li {
  margin-bottom: 0.5rem;
  display: flex;
  gap: 0.75rem;
  align-items: baseline;
}

.post-list .post-date {
  color: var(--text-muted);
  font-size: 0.8rem;
  white-space: nowrap;
}

.post-list .post-date::before {
  content: '[';
  color: var(--border);
}

.post-list .post-date::after {
  content: ']';
  color: var(--border);
}

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

.post-list .post-link:hover {
  color: var(--accent);
}

/* --- Pagination --- */
.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
}

.pagination a {
  color: var(--accent);
}

.pagination .disabled {
  color: var(--text-muted);
}

.pagination .page-info {
  color: var(--text-muted);
}

/* --- Post Navigation (Prev/Next) --- */
.post-nav {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
}

.post-nav .nav-direction {
  color: var(--text-muted);
  font-size: 0.75rem;
  display: block;
  margin-bottom: 0.25rem;
}

.post-nav .nav-prev {
  text-align: left;
}

.post-nav .nav-next {
  text-align: right;
  margin-left: auto;
}

/* --- Related Posts --- */
.related-posts {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.related-posts .section-label {
  color: var(--accent);
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.related-posts .section-label::before {
  content: '> ';
}

.related-posts ul {
  list-style: none;
  padding: 0;
}

.related-posts li {
  margin-bottom: 0.35rem;
}

.related-posts li::before {
  content: '\251C\2500\2500 ';
  color: var(--border);
}

.related-posts li:last-child::before {
  content: '\2514\2500\2500 ';
  color: var(--border);
}

.related-posts a {
  color: var(--text);
}

.related-posts a:hover {
  color: var(--accent);
}

/* ============================================
   Homepage
   ============================================ */

/* --- Hero --- */
.hero {
  padding: 4rem 0 3rem;
  border-bottom: 2px solid var(--accent-strong);
  margin-bottom: 3rem;
}

.hero-title {
  font-size: 2.5rem;
  color: var(--heading);
  margin: 0 0 0.75rem;
  line-height: 1.1;
}

.hero-title::before {
  content: '> ';
  color: var(--accent);
}

.hero-title .cursor {
  color: var(--accent);
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.hero-tagline {
  font-size: 1rem;
  color: var(--text-muted);
  max-width: 50ch;
}

/* --- Homepage Sections --- */
.home-section {
  margin-bottom: 3rem;
}

.home-section .terminal-header {
  margin-bottom: 1rem;
}

/* --- About Snippet --- */
.about-snippet {
  border-left: 3px solid var(--accent-strong);
  padding: 1rem 1.25rem;
  margin-bottom: 3rem;
  color: var(--text);
  font-size: 0.9rem;
}

.about-snippet p:last-child {
  margin-bottom: 0;
}

/* ============================================
   Newsletter
   ============================================ */
.newsletter-cta {
  border: 2px solid var(--accent-strong);
  padding: 2rem;
  margin: 3rem 0;
  background-color: var(--bg-surface);
}

.newsletter-cta .cta-header {
  font-size: 1.1rem;
  color: var(--heading);
  margin-bottom: 0.5rem;
  font-weight: 700;
}

.newsletter-cta .cta-header::before {
  content: '> ';
  color: var(--accent);
}

.newsletter-cta .cta-text {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 1.25rem;
}

.newsletter-cta .cta-text:last-child {
  margin-bottom: 0;
}

.newsletter-form {
  display: flex;
  gap: 0;
}

.newsletter-form input[type="email"] {
  flex: 1;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  padding: 0.6rem 0.8rem;
  background-color: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-right: none;
  outline: none;
}

.newsletter-form input[type="email"]::placeholder {
  color: var(--text-muted);
}

.newsletter-form input[type="email"]:focus {
  border-color: var(--accent);
}

.newsletter-form button {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  padding: 0.6rem 1.25rem;
  background-color: var(--accent-strong);
  color: var(--heading);
  border: 1px solid var(--accent-strong);
  cursor: pointer;
  font-weight: 700;
  transition: background-color 0.15s ease;
  white-space: nowrap;
}

.newsletter-form button:hover {
  background-color: var(--accent);
  border-color: var(--accent);
}

/* ============================================
   Footer
   ============================================ */
.site-footer {
  border-top: 2px solid var(--accent-strong);
  padding: 2rem 0;
  margin-top: auto;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.footer-content {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.footer-links {
  display: flex;
  gap: 1rem;
  list-style: none;
}

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

.footer-links a:hover {
  color: var(--accent);
}

.footer-handle {
  color: var(--accent);
}

.footer-handle::before {
  content: '> ';
  color: var(--text-muted);
}

/* ============================================
   Taxonomy Pages (Tags, Pillars, Series)
   ============================================ */
.taxonomy-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 2rem;
}

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

.taxonomy-filter .filter-label {
  color: var(--accent);
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 768px) {
  html {
    font-size: 16px;
  }

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

  .post-title {
    font-size: 1.5rem;
  }

  .site-header .container {
    flex-direction: column;
    align-items: flex-start;
  }

  .site-nav {
    gap: 0;
  }

  .post-meta {
    flex-direction: column;
    gap: 0.35rem;
  }

  .post-nav {
    flex-direction: column;
  }

  .post-nav .nav-next {
    text-align: left;
    margin-left: 0;
  }

  .newsletter-form {
    flex-direction: column;
  }

  .newsletter-form input[type="email"] {
    border-right: 1px solid var(--border);
    border-bottom: none;
  }

  .footer-content {
    flex-direction: column;
    align-items: flex-start;
  }

  .post-list li {
    flex-direction: column;
    gap: 0.1rem;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 1rem;
  }

  .hero {
    padding: 2.5rem 0 2rem;
  }

  .newsletter-cta {
    padding: 1.25rem;
  }
}
