/* ============================================
   Dark Robot — 暗黑极简设计规范
   ============================================ */

/* Google Fonts loaded via <link> in HTML */

/* ---------- Design Tokens ---------- */
:root {
  /* Background */
  --bg-body: #0d0d0d;
  --bg-card: #1a1a1a;
  --bg-warm: #1a1a1a;

  /* Text */
  --text-body: #e0e0e0;
  --text-heading: #ffffff;
  --text-secondary: #666666;
  --text-muted: #555555;
  --text-disabled: #444444;

  /* Border */
  --border-standard: #2a2a2a;
  --border-input: #333333;

  /* Accent — 荧光绿 */
  --accent: #a3ff4d;
  --accent-hover: #beff73;
  --accent-active: #8ce030;

  /* Focus / Status */
  --focus: #a3ff4d;
  --shadow-btn: none;
  --shadow-input: none;
  --success: #a3ff4d;
  --warning: #ffe500;
  --error: #ff4444;
  --switch-on: #a3ff4d;
  --switch-off: #444444;

  /* Code */
  --code-bg: #111111;
  --code-border: #2a2a2a;
  --code-text: #e0e0e0;

  /* Sidebar */
  --sidebar-active: #2a2a2a;
  --sidebar-hover: #222222;

  /* Shape */
  --radius-btn: 4px;
  --radius-card: 4px;
  --radius-input: 4px;
  --radius-code: 4px;
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);

  /* Typography */
  --font: Inter, 'Noto Sans SC', -apple-system, 'PingFang SC', 'Microsoft YaHei', 'Hiragino Sans GB', sans-serif;

  /* Card palette — monochrome with accent hints */
  --card-default: #1a1a1a;
  --app-pink: #1a1a1a;
  --purple: #1a1a1a;
  --app-blue: #1a1a1a;
  --app-yellow: #1a1a1a;
  --app-orange: #1a1a1a;
  --app-teal: #1a1a1a;
  --app-green: #1a1a1a;
  --app-red: #1a1a1a;
  --lime-green: #1a1a1a;
  --yellow-green: #1a1a1a;
  --brown: #2a2a2a;
  --warm-peach-pink: #1a1a1a;
}

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

html {
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  font-weight: 400;
  background-color: var(--bg-body);
  color: var(--text-body);
  line-height: 1.7;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Light mode overrides (toggled by JS adding/removing .light class) */
body.light {
  --bg-body: #f5f5f5;
  --bg-card: #ffffff;
  --bg-warm: #ffffff;
  --text-body: #1a1a1a;
  --text-heading: #000000;
  --text-secondary: #888888;
  --text-muted: #999999;
  --text-disabled: #bbbbbb;
  --border-standard: #e5e5e5;
  --border-input: #dddddd;
  --code-bg: #f0f0f0;
  --code-border: #e0e0e0;
  --code-text: #1a1a1a;
  --card-default: #ffffff;
}

body.light .nav-bar {
  background: #ffffff;
  border-bottom: 1px solid var(--border-standard);
}

body.light .footer-wave { color: var(--text-secondary); }

a { color: var(--accent); text-decoration: none; font-weight: 500; }
a:hover { color: var(--accent-hover); }
a.internal-link { text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 4px; }
a.internal-link:hover { color: var(--accent); text-decoration-style: solid; }

h1, h2, h3, h4, h5, h6 {
  color: var(--text-heading);
  font-weight: 600;
  line-height: 1.3;
}
h1 { font-size: 24px; }
h2 { font-size: 20px; }
h3 { font-size: 17px; }
h4 { font-size: 15px; }

/* ---------- Navbar ---------- */
.nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  height: 56px;
  background: var(--bg-body);
  border-bottom: 1px solid var(--border-standard);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
}
.nav-left { display: flex; align-items: center; gap: 32px; }
.nav-right { display: flex; align-items: center; gap: 8px; }
.nav-brand {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-heading);
  text-decoration: none;
  letter-spacing: 0.04em;
}
.nav-links { display: flex; gap: 4px; }
.nav-link {
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: var(--radius-btn);
  transition: color 0.15s, background 0.15s;
  position: relative;
}
.nav-link:hover { color: var(--text-heading); background: var(--bg-card); }
.nav-link.active { color: var(--accent); font-weight: 600; }
.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: 4px;
  left: 14px;
  right: 14px;
  height: 1px;
  background: var(--accent);
}

/* Icon buttons */
.nav-icon-btn {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: var(--radius-btn);
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  background: transparent;
  transition: color 0.15s, background 0.15s;
}
.nav-icon-btn:hover { color: var(--text-heading); background: var(--bg-card); }
.nav-hamburger { display: none; width: 44px; height: 44px; border: none; background: transparent; font-size: 20px; color: var(--text-secondary); cursor: pointer; }
.nav-hamburger:hover { color: var(--text-heading); }

/* Search box */
.search-box { position: relative; display: flex; align-items: center; }
.search-box-icon { font-size: 14px; color: var(--text-muted); margin-right: 4px; }
.search-box-input {
  border: 1px solid var(--border-input);
  background: var(--bg-card);
  color: var(--text-body);
  padding: 6px 12px;
  border-radius: var(--radius-input);
  font-size: 13px;
  font-family: var(--font);
  width: 180px;
  transition: border-color 0.2s, width 0.2s;
  outline: none;
}
.search-box-input:focus { border-color: var(--accent); width: 240px; }
.search-box-kbd { display: none; }
.search-dropdown { position: absolute; top: 100%; right: 0; margin-top: 4px; width: 360px; max-height: 400px; background: var(--bg-card); border: 1px solid var(--border-standard); border-radius: var(--radius-card); overflow-y: auto; box-shadow: 0 8px 32px rgba(0,0,0,0.4); display: none; z-index: 200; }
.search-dropdown.active { display: block; }
.search-dropdown-results { padding: 4px; }
.search-dropdown-footer { padding: 8px 12px; font-size: 11px; color: var(--text-muted); border-top: 1px solid var(--border-standard); display: flex; justify-content: space-between; }
.search-dropdown .search-result-item { padding: 8px 12px; border-radius: var(--radius-btn); cursor: pointer; font-size: 13px; }
.search-dropdown .search-result-item:hover,
.search-dropdown .search-result-item.active { background: var(--sidebar-hover); }
.search-dropdown .search-result-title { font-weight: 600; color: var(--text-heading); }
.search-dropdown .search-result-meta { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* Mobile nav */
@media (max-width: 768px) {
  .nav-bar { padding: 0 16px; }
  .nav-links { display: none; position: absolute; top: 56px; left: 0; right: 0; background: var(--bg-card); flex-direction: column; padding: 8px; border-bottom: 1px solid var(--border-standard); z-index: 99; }
  .nav-links.open { display: flex; }
  .nav-hamburger { display: flex; align-items: center; justify-content: center; }
  .search-box-input { width: 120px; }
  .search-box-input:focus { width: 160px; }
  .search-dropdown { width: 280px; }
}
@media (max-width: 480px) {
  .nav-bar { padding: 0 12px; }
}

/* ---------- Container ---------- */
.container { max-width: 960px; margin: 0 auto; padding: 0 20px; }

/* ---------- Button ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  padding: 0 20px;
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font);
  border: 1px solid var(--border-standard);
  background: var(--bg-card);
  color: var(--text-body);
  border-radius: var(--radius-btn);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
  box-shadow: none;
}
.btn:hover { border-color: var(--accent); color: var(--accent); transform: none; box-shadow: none; }
.btn:active { transform: none; box-shadow: none; }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn-primary { background: var(--accent); color: #0d0d0d; border-color: var(--accent); font-weight: 600; box-shadow: none; }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #0d0d0d; box-shadow: none; }
.btn-primary:active { background: var(--accent-active); box-shadow: none; }
.btn-sm { height: 28px; padding: 0 12px; font-size: 11px; border-radius: var(--radius-btn); }
.btn-lg { height: 48px; padding: 0 28px; font-size: 15px; border-radius: var(--radius-btn); }

.input {
  width: 100%;
  height: 40px;
  padding: 0 16px;
  font-size: 14px;
  font-family: var(--font);
  background: var(--bg-body);
  border: 1px solid var(--border-input);
  border-radius: var(--radius-input);
  color: var(--text-body);
  box-shadow: none;
  transition: border-color 0.2s;
  outline: none;
}
.input:hover { border-color: var(--text-muted); }
.input:focus { border-color: var(--accent); box-shadow: none; }
.input-lg { height: 48px; padding: 0 18px; font-size: 15px; }
.input-sm { height: 32px; padding: 0 12px; font-size: 12px; }

.textarea {
  width: 100%;
  padding: 14px 16px;
  font-size: 14px;
  font-family: var(--font);
  background: var(--bg-body);
  border: 1px solid var(--border-input);
  border-radius: var(--radius-input);
  color: var(--text-body);
  resize: vertical;
  min-height: 200px;
  box-shadow: none;
  transition: border-color 0.2s;
  outline: none;
  line-height: 1.7;
}
.textarea:focus { border-color: var(--accent); box-shadow: none; }

.select {
  height: 40px;
  padding: 0 16px;
  font-size: 14px;
  font-family: var(--font);
  background: var(--bg-body);
  border: 1px solid var(--border-input);
  border-radius: var(--radius-input);
  color: var(--text-body);
  box-shadow: none;
  cursor: pointer;
  outline: none;
}
.select:focus { border-color: var(--accent); box-shadow: none; }

.tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 0.04em;
  padding: 2px 0;
}

/* ---------- Code Block ---------- */
.code-block-wrap {
  position: relative;
  margin: 24px 0;
  border-radius: var(--radius-code);
  overflow: hidden;
  border: 1px solid var(--code-border);
  background: var(--code-bg);
}
.code-block-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 16px;
  background: rgba(255,255,255,0.03);
  border-bottom: 1px solid var(--code-border);
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
}
.code-block-wrap pre { margin: 0; padding: 16px; overflow-x: auto; }
.code-block-wrap code {
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', Consolas, monospace;
  font-size: 13px;
  line-height: 1.6;
  color: var(--code-text);
}

/* Inline code */
:not(.code-block) > code {
  background: var(--code-bg);
  color: var(--code-text);
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 0.9em;
  font-family: 'SF Mono', 'Fira Code', monospace;
  border: 1px solid var(--code-border);
}

/* ---------- Post List Card ---------- */
.post-card {
  background: var(--bg-card);
  border-radius: var(--radius-card);
  padding: 20px 24px;
  margin-bottom: 16px;
  box-shadow: 0 4px 10px rgba(107, 92, 67, 0.2);
  transition: all var(--transition);
  display: block;
  text-decoration: none;
  color: inherit;
  position: relative;
  overflow: hidden;
}
.post-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 5px;
}
.post-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(114, 93, 66, 0.2);
}
.post-card:active {
  transform: translateY(-1px);
  box-shadow: 0 3px 6px rgba(107, 92, 67, 0.2);
  transition: all 0.1s ease;
}
.post-card .post-tag { margin-bottom: 4px; }
.post-card .post-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-heading);
  margin: 4px 0;
}
.post-card .post-excerpt {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
}
.post-card .post-meta {
  font-size: 11px;
  color: var(--text-disabled);
  margin-top: 10px;
  display: flex;
  gap: 16px;
}

/* ---------- Note Card ---------- */
.note-card {
  background: var(--bg-body);
  border: 1px solid var(--border-standard);
  border-radius: var(--radius-card);
  padding: 20px;
  margin-bottom: 12px;
  color: var(--text-body);
  transition: border-color 0.2s;
}
.note-card:hover { border-color: var(--text-muted); }
.note-date { font-size: 11px; color: var(--text-muted); }

/* ---------- Article Layout ---------- */
.mt-20 { margin-top: 20px; }
.mt-32 { margin-top: 32px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.flex-row { display: flex; align-items: center; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-12 { gap: 12px; }

.post-layout {
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 40px;
  max-width: 960px;
  margin: 0 auto;
  padding: 0 20px;
}
.article-body { min-width: 0; }
.article-body h2 { font-size: 22px; margin: 40px 0 12px; }
.article-body h3 { font-size: 18px; margin: 32px 0 8px; }
.article-body p { margin: 12px 0; line-height: 1.8; }
.article-body ul, .article-body ol { margin: 12px 0; padding-left: 24px; }
.article-body li { margin: 6px 0; }
.article-body blockquote {
  margin: 16px 0;
  padding: 12px 20px;
  border-left: 3px solid var(--accent);
  background: var(--bg-body);
  border-radius: 0 var(--radius-card) var(--radius-card) 0;
  font-style: italic;
  color: var(--text-secondary);
}
.article-body img { max-width: 100%; border-radius: var(--radius-card); margin: 16px 0; }
.article-body hr { border: none; border-top: 1px solid var(--border-standard); margin: 32px 0; }

@media (max-width: 768px) {
  .post-layout { grid-template-columns: 1fr; }
}

.toc-sidebar { position: relative; }
.toc-sticky { position: sticky; top: 72px; }
.toc-content { font-size: 13px; }
.toc-content ul { list-style: none; padding-left: 0; }
.toc-content li { margin: 6px 0; }
.toc-content a { color: var(--text-secondary); text-decoration: none; }
.toc-content a:hover { color: var(--accent); }

/* Card */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-standard);
  border-radius: var(--radius-card);
  padding: 24px;
  box-shadow: none;
}
.card:hover { transform: none; box-shadow: none; }
.card-clickable { cursor: pointer; }
.card-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-heading);
}

/* Dividers */
.divider { height: 1px; background: var(--border-standard); margin: 24px 0; border: none; border-radius: 0; }
.divider-teal { background: var(--accent); opacity: 0.3; }
.divider-brown { background: var(--border-standard); }
.divider-yellow { background: var(--accent); opacity: 0.2; }

/* Post meta */
.post-meta { display: flex; gap: 16px; flex-wrap: wrap; color: var(--text-muted); font-size: 12px; }

/* Comment section */
.comment-section { margin-bottom: 60px; }
.comment-item {
  margin-bottom: 12px;
  padding: 16px;
  background: var(--bg-body);
  border: 1px solid var(--border-standard);
  border-radius: var(--radius-card);
}
.section-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-heading);
  margin: 16px 0;
}

/* Page header */
.page-header { text-align: center; padding: 40px 20px 20px; }
.page-header h1 { font-weight: 700; letter-spacing: 0.04em; }
.subtitle { color: var(--text-secondary); font-size: 15px; margin-top: 8px; }

.text-center { text-align: center; }
.text-muted { color: var(--text-muted); font-size: 13px; }
.mt-24 { margin-top: 24px; }
.mb-40 { margin-bottom: 40px; }

.article-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
  font-size: 13px;
}
.article-body th, .article-body td {
  padding: 8px 12px;
  border: 1px solid var(--border-input);
  text-align: left;
}
.article-body th { background: rgba(25, 200, 185, 0.1); font-weight: 700; color: var(--text-heading); }

/* ---------- Avatar ---------- */
.avatar-circle {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--bg-body);
  border: 2px solid var(--border-standard);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  font-size: 32px;
}

/* ---------- Section Strip ---------- */
.section-strip {
  position: relative;
  z-index: 1;
}

/* ---------- Footer ---------- */
.footer-wave {
  max-width: 960px;
  margin: 60px auto 12px;
  padding: 0 20px;
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}
.footer {
  max-width: 960px;
  margin: 0 auto 40px;
  padding: 0 20px;
  font-size: 12px;
  color: var(--text-disabled);
  line-height: 1.8;
}
.footer a { color: var(--text-secondary); font-weight: 500; }
.footer a:hover { color: var(--accent); }

/* ---------- Preview Box ---------- */
.preview-box {
  padding: 16px;
  border: 2px dashed var(--border-input);
  border-radius: var(--radius-card);
  min-height: 80px;
  font-size: 14px;
  color: var(--text-body);
  background: var(--bg-warm);
}



/* ---------- Back to Top ---------- */
.back-to-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 50;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border-standard);
  background: var(--bg-card);
  color: var(--text-secondary);
  border-radius: var(--radius-btn);
  font-size: 16px;
  cursor: pointer;
  display: none;
  transition: color 0.15s, border-color 0.15s;
  align-items: center;
  justify-content: center;
}
.back-to-top:hover { color: var(--accent); border-color: var(--accent); }
.back-to-top.visible { display: flex; }

/* ---------- Welcome Modal ---------- */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-box {
  background: var(--bg-card);
  border-radius: 40px 35px 45px 38px / 38px 45px 35px 40px;
  padding: 40px 36px 32px;
  max-width: 460px;
  width: 90%;
  text-align: center;
  box-shadow: 0 8px 40px rgba(0,0,0,0.3);
  position: relative;
  animation: modalPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes modalPop {
  0% { transform: scale(0.8); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}
.modal-box .modal-icon { font-size: 48px; margin-bottom: 12px; }
.modal-box h3 { font-size: 20px; color: var(--text-heading); margin-bottom: 8px; }
.modal-box p { font-size: 14px; color: var(--text-secondary); line-height: 1.8; min-height: 50px; }

/* ---------- Click Leaf Effect ---------- */
.click-leaf {
  position: fixed;
  pointer-events: none;
  z-index: 99999;
  font-size: 20px;
  animation: leafFloat 1s ease-out forwards;
}
@keyframes leafFloat {
  0%   { opacity: 1; transform: translate(0, 0) rotate(0deg) scale(1); }
  100% { opacity: 0; transform: translate(var(--dx), var(--dy)) rotate(var(--rot)) scale(0.3); }
}

/* ---------- Random Visitor ---------- */
.visitor {
  position: fixed;
  bottom: -60px;
  z-index: 100;
  font-size: 40px;
  cursor: pointer;
  animation: visitorPeek 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards,
             visitorBounce 2s ease-in-out 0.6s infinite;
  transition: opacity 0.3s;
}
.visitor:hover { transform: scale(1.2); }
@keyframes visitorPeek {
  0%   { transform: translateY(0); }
  100% { transform: translateY(-70px); }
}
@keyframes visitorBounce {
  0%, 100% { transform: translateY(-70px); }
  50%      { transform: translateY(-80px); }
}
.visitor-leaving {
  animation: visitorLeave 0.5s ease-in forwards;
}
@keyframes visitorLeave {
  0%   { transform: translateY(-70px); opacity: 1; }
  100% { transform: translateY(0); opacity: 0; }
}
.visitor-speech {
  position: fixed;
  background: var(--bg-card);
  border: 2px solid var(--border-standard);
  border-radius: 20px;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-heading);
  z-index: 101;
  animation: speechPop 0.3s ease-out;
  box-shadow: 0 3px 0 0 var(--shadow-btn);
}
@keyframes speechPop {
  0% { transform: scale(0); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

/* ---------- Scroll Reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Reading Progress Bar ---------- */
.progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  z-index: 9999;
  transition: width 0.1s linear;
}

/* ---------- Random Article Button ---------- */
#diceBtn.spinning { animation: diceSpin 0.6s ease-out; }
@keyframes diceSpin {
  0%   { transform: rotate(0deg); }
  100% { transform: rotate(720deg); }
}



/* ---------- Code Copy Button ---------- */
.code-copy-btn {
  position: absolute;
  top: 10px;
  right: 12px;
  padding: 4px 12px;
  font-family: var(--font);
  font-size: 11px;
  font-weight: 600;
  color: #c8d8c8;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 20px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s;
  z-index: 2;
}
.code-block-wrap:hover .code-copy-btn { opacity: 1; }
.code-copy-btn.copied { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ---------- Code Language Label ---------- */
.code-lang-label {
  position: absolute;
  top: 10px;
  left: 12px;
  padding: 3px 10px;
  font-family: var(--font);
  font-size: 10px;
  font-weight: 700;
  color: rgba(232, 213, 188, 0.6);
  background: rgba(255,255,255,0.06);
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  z-index: 2;
}

/* ---------- Code Line Numbers ---------- */
.code-line-numbers {
  position: absolute;
  top: 0; left: 0; bottom: 0;
  width: 44px;
  padding: 20px 0;
  background: rgba(0,0,0,0.2);
  border-radius: var(--radius-code) 0 0 var(--radius-code);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  padding-right: 10px;
  user-select: none;
  overflow: hidden;
}
.code-line-numbers span {
  font-family: 'SF Mono', 'Fira Code', Consolas, monospace;
  font-size: 11px;
  line-height: 1.8;
  color: rgba(232, 213, 188, 0.35);
  font-weight: 500;
}
.code-with-lines {
  display: block;
  padding-left: 54px !important;
}

/* ---------- Image Lightbox ---------- */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
  transition: background 0.3s ease;
}
.lightbox-overlay.open {
  background: rgba(0,0,0,0.85);
}
.lightbox-overlay img {
  max-width: 90vw;
  max-height: 90vh;
  border-radius: 12px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.4);
  transform: scale(0.9);
  opacity: 0;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.25s ease;
}
.lightbox-overlay.open img {
  transform: scale(1);
  opacity: 1;
}

/* ---------- Print ---------- */
@media print {
  .nav-bar, .footer-wave, .footer, .back-to-top, .toc-sidebar, .progress-bar,
  .divider, .tag-filter, .notes-sidebar,
  .lightbox-overlay, .code-copy-btn, .code-lang-label,
  .code-line-numbers { display: none !important; }
  .code-with-lines { padding-left: 0 !important; }
  body { background: #fff !important; color: #000 !important; font-size: 14px; }
  .article-body { box-shadow: none; padding: 0; }
  a { color: #000; text-decoration: underline; }
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .main-layout, .post-layout { flex-direction: column; }
  .notes-sidebar, .toc-sidebar { width: 100%; }
  .container { padding: 0 16px; }

  /* Cards */
  .post-card { padding: 16px 18px; }
  .post-card .post-title { font-size: 15px; }
  .post-card .post-excerpt { font-size: 12px; }
  .section-strip { padding: 20px !important; border-radius: 20px !important; }

  /* Article body */
  .article-body { padding: 20px; font-size: 14px; line-height: 1.8; }
  .article-body h1 { font-size: 20px; }
  .article-body h2 { font-size: 17px; }
  .article-body h3 { font-size: 15px; }
  .code-block { padding: 14px 16px; font-size: 12px; }
  .code-block-wrap:hover .code-copy-btn { opacity: 1; }
  .code-line-numbers { width: 36px; padding-right: 6px; }
  .code-line-numbers span { font-size: 10px; }
  .code-with-lines { padding-left: 44px !important; }
  .code-lang-label { font-size: 9px; padding: 2px 8px; }
  .code-copy-btn { font-size: 10px; padding: 3px 10px; }

  /* Page header */
  .page-header { padding: 20px 0 6px; }
  .page-header h1 { font-size: 20px; }

  /* Tag filter */
  .tag-filter { gap: 6px; }
  .tag-filter-btn { padding: 5px 14px; font-size: 11px; }

  /* Back to top */
  .back-to-top { bottom: 20px; right: 16px; width: 40px; height: 40px; font-size: 16px; }

  /* Welcome modal */
  .modal-box { padding: 28px 20px 24px; border-radius: 30px; }
  .modal-box h3 { font-size: 17px; }

  /* Divider */
  .divider { height: 8px; margin: 16px auto; }
}

/* Phone breakpoint */
@media (max-width: 480px) {
  .article-body { padding: 16px; border-radius: 16px; }
  .post-card { padding: 14px; }
  .note-card { padding: 12px 14px; }

  .back-to-top { bottom: 14px; right: 8px; width: 36px; height: 36px; font-size: 14px; }

  .footer { font-size: 10px; }

  .container { padding: 0 10px; }
}

/* ============================================
   HUMAN MADE inspired effects
   ============================================ */



/* ---------- Parallax sticky section ---------- */
.parallax-section {
  position: relative;
  margin: 40px 0;
}
.parallax-sticky {
  position: sticky;
  top: 120px;
  z-index: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.parallax-sticky-inner {
  font-size: 80px;
  opacity: 0.25;
  transition: transform 0.1s linear;
  user-select: none;
}
.parallax-content {
  position: relative;
  z-index: 1;
  margin-top: -200px;
}
.parallax-content .post-card,
.parallax-content .card {
  position: relative;
  z-index: 2;
}


.stagger-reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.stagger-reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}


/* ---------- Responsive: parallax ---------- */
@media (max-width: 768px) {
  .parallax-sticky-inner {
    font-size: 48px;
  }
  .parallax-content {
    margin-top: -120px;
  }
}

/* ============================================
   HUMAN MADE style — big type, lots of space
   ============================================ */

/* ---------- Container ---------- */
.container {
  max-width: 100%;
  padding: 0;
}
.container > *:not(.hm-hero):not(.hm-statement):not(.hm-posts):not(.hm-notes):not(.hm-cta):not(.divider):not(.page-header):not(.card):not(.post-layout):not(.flex-between):not(.comment-section):not(.nav-bar):not(.footer-wave):not(.footer):not(.mt-20):not(script) {
  max-width: 960px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 20px;
  padding-right: 20px;
}

/* ---------- Hero ---------- */
.hm-hero {
  border-radius: 0;
  position: relative;
  margin: 0 0 2px;
  overflow: hidden;
  background: radial-gradient(ellipse at center, #2a2a2a 0%, #0d0d0d 70%);
  height: 85vh;
  min-height: 500px;
}

.hm-hero-spline {
  position: absolute;
  inset: 0;
  border: none;
}

.hm-hero-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 1;
  pointer-events: none;
  padding: 0 24px;
}

.hm-hero-title {
  font-family: var(--font);
  font-size: clamp(48px, 8vw, 96px);
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.08em;
  text-align: center;
  mix-blend-mode: difference;
  text-shadow: 0 0 40px rgba(0,0,0,0.5);
  line-height: 1;
}

.hm-hero-subtitle {
  font-family: var(--font);
  font-size: clamp(14px, 1.5vw, 18px);
  font-weight: 400;
  color: var(--text-secondary);
  letter-spacing: 0.06em;
  margin-top: 20px;
  text-align: center;
}

@media (max-width: 768px) {
  .hm-hero { height: 60vh; min-height: 350px; }
  .hm-hero-title { font-size: clamp(36px, 12vw, 56px); }
}
@media (max-width: 480px) {
  .hm-hero { height: 50vh; min-height: 280px; }
}

/* ---------- Statement ---------- */
.hm-statement {
  background: var(--bg-card);
  margin: 0 0 2px;
  border-radius: 0;
}
.hm-statement-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: clamp(60px, 8vw, 100px) 24px;
}
.hm-statement-text {
  font-size: clamp(32px, 5vw, 56px);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0.03em;
  color: var(--text-heading);
}

/* ---------- Posts Section ---------- */
.hm-posts {
  background: var(--bg-card);
  margin: 0 0 2px;
  border-radius: 0;
}
.hm-posts-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: clamp(48px, 6vw, 80px) 24px;
}
.hm-posts-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 40px;
}
.hm-section-title {
  font-size: clamp(24px, 3.5vw, 36px);
  font-weight: 700;
  color: var(--text-heading);
  letter-spacing: 0.04em;
  margin-bottom: 0;
}
.hm-posts-body { /* grid handled below */ }
.hm-posts-grid { display: flex; flex-direction: column; gap: 0; }
.hm-post-card {
  display: block;
  padding: 28px 0 28px 16px;
  text-decoration: none;
  color: inherit;
  border-left: 2px solid var(--border-standard);
  border-bottom: 1px solid var(--border-standard);
  transition: border-left-color 0.2s, padding 0.2s;
  position: relative;
}
.hm-post-card:first-child { border-top: 1px solid var(--border-standard); }
.hm-post-card:hover { border-left-color: var(--accent); padding-left: 24px; }
.hm-post-card-tag {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.hm-post-card-title {
  font-size: clamp(18px, 2vw, 22px);
  font-weight: 600;
  color: var(--text-heading);
  line-height: 1.4;
  margin-bottom: 4px;
}
.hm-post-card-excerpt {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 8px;
}
.hm-post-card-meta {
  display: flex;
  gap: 16px;
  font-size: 12px;
  color: var(--text-muted);
}

/* Tag filter */
.tag-filter { display: flex; gap: 8px; flex-wrap: wrap; }
.tag-filter-btn {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  padding: 4px 12px;
  border: 1px solid var(--border-standard);
  border-radius: var(--radius-btn);
  transition: all 0.15s;
}
.tag-filter-btn:hover { color: var(--text-heading); border-color: var(--text-secondary); }
.tag-filter-btn.active { color: var(--accent); border-color: var(--accent); background: rgba(163, 255, 77, 0.05); }

.hm-empty { text-align: center; padding: 80px 20px; color: var(--text-secondary); font-size: 16px; }

/* ---------- Notes Section ---------- */
.hm-notes {
  background: var(--bg-card);
  margin: 0 0 2px;
  border-radius: 0;
}
.hm-notes-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: clamp(48px, 6vw, 80px) 24px;
}
.hm-notes-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 32px;
}
.hm-more-link { font-size: 13px; font-weight: 500; color: var(--accent); text-decoration: none; }
.hm-more-link:hover { color: var(--accent-hover); }
.hm-notes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}
.hm-note-card {
  padding: 20px;
  border-radius: var(--radius-card);
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-body);
  background: var(--bg-body);
  border-left: 3px solid var(--border-standard);
}
.hm-note-date { font-size: 11px; color: var(--text-muted); margin-top: 8px; }

/* ---------- CTA ---------- */
.hm-cta {
  background: var(--bg-card);
  margin: 0 0 2px;
  border-radius: 0;
}
.hm-cta-inner {
  max-width: 600px;
  margin: 0 auto;
  padding: clamp(48px, 6vw, 80px) 24px;
  text-align: center;
}
.hm-cta-text {
  font-size: clamp(24px, 3.5vw, 36px);
  font-weight: 700;
  color: var(--text-heading);
  margin-bottom: 28px;
  letter-spacing: 0.04em;
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .hm-statement-inner {
    padding: 60px 20px;
  }
  .hm-posts-inner,
  .hm-notes-inner,
  .hm-cta-inner {
    padding: 48px 20px;
  }
  .hm-posts-head {
    flex-direction: column;
    align-items: flex-start;
    margin-bottom: 32px;
  }
  .hm-notes-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .hm-note-card {
    padding: 18px;
  }
}

@media (max-width: 480px) {
  .hm-notes-grid {
    grid-template-columns: 1fr;
  }
}
