/* bay41 — terminal workshop aesthetic */
/* Blog Awesome simplicity × re-Terminal energy × bay41 palette */

@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:ital,wght@0,400;0,500;0,600;0,700;0,800;1,400&family=Source+Serif+4:ital,wght@0,400;0,500;0,600;1,400&display=swap');

:root {
  --bg: #07132b;
  --bg-soft: #0c1a38;
  --bg-card: #112044;
  --border: #182850;
  --border-hover: #243566;

  --text: #cdd6f4;
  --text-sub: #8891b0;
  --text-muted: #4a5278;

  --orange: #de8053;
  --orange-soft: #c47048;
  --orange-glow: rgba(222, 128, 83, 0.08);
  --magenta: #bf3e5d;
  --magenta-soft: #a03350;
  --magenta-glow: rgba(191, 62, 93, 0.1);
  --teal: #34b5ba;
  --teal-soft: #2a9599;
  --teal-glow: rgba(52, 181, 186, 0.08);
  --coral: #e06070;

  --mono: 'JetBrains Mono', 'Fira Code', monospace;
  --serif: 'Source Serif 4', Georgia, serif;
  --max-w: 720px;
  --radius: 4px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--mono);
  line-height: 1.75;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: rgba(52, 181, 186, 0.25);
  color: #fff;
}

/* ═══════════════════════════════════════════
   LAYOUT
   ═══════════════════════════════════════════ */

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

/* ═══════════════════════════════════════════
   HEADER
   ═══════════════════════════════════════════ */

.site-header {
  padding: 3rem 0 2rem;
  margin-bottom: 2.5rem;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-logo {
  font-family: var(--mono);
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--magenta);
  text-decoration: none;
  letter-spacing: -0.03em;
}

.site-logo:hover { color: var(--teal); }

.site-logo .cursor {
  color: var(--teal);
  font-weight: 400;
  animation: blink 1s step-end infinite;
}

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

.site-tagline {
  font-size: 0.72rem;
  color: var(--teal-soft);
  margin-top: 0.3rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 400;
}

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

.site-nav a {
  font-size: 0.85rem;
  color: var(--text-sub);
  text-decoration: none;
  transition: color 0.15s;
  font-weight: 500;
}

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

/* ═══════════════════════════════════════════
   POST LIST
   ═══════════════════════════════════════════ */

.post-list { list-style: none; }

.post-item {
  padding: 2rem 0;
  border-bottom: 1px solid var(--border);
}

.post-item:first-child { padding-top: 0; }
.post-item:last-child { border-bottom: none; }

.post-date {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.post-item h2 {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.4;
  margin-top: 0.3rem;
}

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

.post-item h2 a:hover { color: var(--magenta); }

.post-excerpt {
  color: var(--text-sub);
  font-size: 0.85rem;
  margin-top: 0.4rem;
  line-height: 1.6;
  font-weight: 400;
}

.post-tags {
  margin-top: 0.6rem;
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.tag {
  font-size: 0.72rem;
  color: var(--teal-soft);
  text-decoration: none;
  transition: color 0.15s;
}

.tag::before { content: "#"; color: var(--text-muted); }
.tag:hover { color: var(--teal); }
.tag:hover::before { color: var(--teal-soft); }

/* ═══════════════════════════════════════════
   SINGLE POST
   ═══════════════════════════════════════════ */

.post-header {
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.post-header h1 {
  font-size: 1.8rem;
  font-weight: 800;
  line-height: 1.3;
  color: var(--text);
  margin-bottom: 0.6rem;
  letter-spacing: -0.02em;
}

.post-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  gap: 1.2rem;
  align-items: center;
}

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

/* ═══════════════════════════════════════════
   POST CONTENT — prose uses serif for readability
   ═══════════════════════════════════════════ */

.post-content {
  font-family: var(--serif);
  font-size: 1.05rem;
  line-height: 1.8;
}

.post-content h2 {
  font-family: var(--mono);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--magenta);
  margin-top: 3rem;
  margin-bottom: 1rem;
  letter-spacing: -0.01em;
}

.post-content h2::before {
  content: "## ";
  color: var(--text-muted);
  font-weight: 400;
}

.post-content h3 {
  font-family: var(--mono);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--teal);
  margin-top: 2.2rem;
  margin-bottom: 0.7rem;
}

.post-content h3::before {
  content: "### ";
  color: var(--text-muted);
  font-weight: 400;
}

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

.post-content a {
  color: var(--teal);
  text-decoration: underline;
  text-decoration-color: rgba(52, 181, 186, 0.3);
  text-underline-offset: 3px;
  transition: text-decoration-color 0.2s;
}

.post-content a:hover { text-decoration-color: var(--teal); }

.post-content strong {
  color: #e8eaf0;
  font-weight: 600;
}

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

.post-content blockquote {
  border-left: 3px solid var(--orange-soft);
  padding: 0.6rem 1.2rem;
  margin: 1.5rem 0;
  background: var(--bg-soft);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--text-sub);
  font-style: italic;
}

.post-content ul, .post-content ol {
  margin: 1rem 0 1.3rem 1.5rem;
}

.post-content li {
  margin-bottom: 0.4rem;
  line-height: 1.7;
}

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

/* Code */
.post-content code {
  font-family: var(--mono);
  font-size: 0.82em;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  padding: 0.15em 0.45em;
  border-radius: 3px;
  color: var(--teal);
}

.post-content pre {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  padding: 1.2rem 1.4rem;
  margin: 1.5rem 0;
  overflow-x: auto;
  border-radius: var(--radius);
}

.post-content pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.85rem;
  color: var(--text);
  line-height: 1.6;
}

/* Images */
.post-content img {
  max-width: 100%;
  height: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin: 1.5rem 0;
}

.post-content figure { margin: 2rem 0; }

.post-content figure img {
  margin: 0;
  display: block;
}

.post-content figcaption {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--text-sub);
  text-align: center;
  margin-top: 0.4rem;
}

.post-content hr {
  border: none;
  border-top: 1px dashed var(--border);
  margin: 2.5rem 0;
}

/* Tables */
.post-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-family: var(--mono);
  font-size: 0.8rem;
  line-height: 1.5;
}

.post-content thead th {
  background: var(--bg-soft);
  color: var(--teal);
  font-weight: 600;
  text-align: left;
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--border);
  white-space: nowrap;
}

.post-content tbody td {
  padding: 0.5rem 0.8rem;
  border: 1px solid var(--border);
  color: var(--text-sub);
}

.post-content tbody tr:hover {
  background: var(--bg-soft);
}

/* TOC */
.toc {
  margin-bottom: 2.5rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  border-left: 2px solid var(--border);
  padding-left: 1rem;
}

.toc-title {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.5rem;
}

.toc nav > ul {
  list-style: none;
  margin: 0;
  padding: 0;
  columns: 2;
  column-gap: 2rem;
}

.toc nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.toc nav > ul > li {
  break-inside: avoid;
  margin-bottom: 0.4rem;
  line-height: 1.4;
}

.toc nav ul li a {
  color: var(--text-sub);
  text-decoration: none;
  transition: color 0.15s;
}

.toc nav ul li a:hover {
  color: var(--teal);
}

.toc nav ul ul {
  display: none;
}

@media (max-width: 600px) {
  .toc nav > ul {
    columns: 1;
  }
}

/* Centered figures */
.post-content figure {
  text-align: center;
}

.post-content figure img {
  margin: 0 auto;
}

/* Callout */
.callout {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--magenta);
  padding: 1rem 1.3rem;
  margin: 1.5rem 0;
  border-radius: 0 var(--radius) var(--radius) 0;
  font-family: var(--mono);
  font-size: 0.88rem;
}

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

/* ═══════════════════════════════════════════
   ABOUT
   ═══════════════════════════════════════════ */

.about-content {
  font-family: var(--serif);
  font-size: 1.05rem;
  line-height: 1.85;
}

.about-content strong { color: var(--magenta); }

/* ═══════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════ */

.site-footer {
  margin-top: 5rem;
  padding: 2rem 0;
  border-top: 1px dashed var(--border);
  font-size: 0.72rem;
  color: var(--text-muted);
  text-align: center;
}

.site-footer .rss-link {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s;
}

.site-footer .rss-link:hover {
  color: var(--teal);
}

/* ═══════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════ */

@media (max-width: 600px) {
  html { font-size: 15px; }
  .site-header { padding: 2rem 0 1.5rem; margin-bottom: 2rem; }
  .header-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  .post-header h1 { font-size: 1.45rem; }
  .site-nav { gap: 1.2rem; }
}
