/* ============================================
   Terminal Dark Brutalist — haoyong.fan
   ============================================ */

/* Google Fonts: Space Mono */
@import url('https://fonts.googleapis.com/css2?family=Space+Mono:ital,wght@0,400;0,700;1,400&display=swap');

/* ============================================
   Design Tokens
   ============================================ */
:root {
  --bg:           #f5f0e8;
  --bg-surface:   #ebe6de;
  --border:       rgba(26, 26, 26, 0.15);
  --border-hover: rgba(26, 26, 26, 0.4);
  --text:         #1a1a1a;
  --text-muted:   rgba(26, 26, 26, 0.55);
  --text-faint:   rgba(26, 26, 26, 0.3);

  --font:         'Space Mono', 'Courier New', Courier, monospace;
  --header-h:     56px;
  --footer-h:     48px;
  --content-max:  min(90vw, 1100px);
  --radius:       2px;
  --transition:   150ms ease;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  font-size: 14px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ============================================
   Header — Fixed Top Nav
   ============================================ */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-h);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  z-index: 100;
}

.site-logo {
  color: var(--text);
  text-decoration: none;
  display: flex;
  align-items: center;
}

.site-logo svg {
  display: block;
}

.site-nav {
  margin-left: auto;
  display: flex;
  gap: 32px;
}

.site-nav a {
  font-size: 12px;
  color: var(--text-muted);
  text-decoration: none;
  letter-spacing: 1px;
  transition: color var(--transition);
}

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

/* ============================================
   Footer — Fixed Bottom Bar
   ============================================ */
.site-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--footer-h);
  background: var(--bg);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 32px;
  z-index: 100;
}

.site-footer a {
  font-size: 11px;
  color: var(--text-muted);
  text-decoration: none;
  letter-spacing: 1px;
  transition: color var(--transition);
}

.site-footer a:hover {
  color: var(--text);
  text-decoration: underline;
}

/* ============================================
   Main Content Area
   ============================================ */
.site-main {
  margin-top: var(--header-h);
  margin-bottom: var(--footer-h);
  padding: 48px 24px;
  flex: 1;
  max-width: var(--content-max);
  width: 100%;
  margin-left: auto;
  margin-right: auto;
}

/* ============================================
   Section Labels
   ============================================ */
.section-label {
  font-size: 12px;
  letter-spacing: 3px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

/* ============================================
   Page Headers
   ============================================ */
.page-title {
  font-size: 40px;
  font-weight: 700;
  letter-spacing: -1px;
  color: var(--text);
  margin-bottom: 8px;
  line-height: 1.1;
}

.page-subtitle {
  font-size: 16px;
  color: var(--text-muted);
  margin-bottom: 40px;
  line-height: 1.7;
}

/* ============================================
   Skill Tags
   ============================================ */
.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.skill-tag {
  border: 1px solid var(--text);
  color: var(--text);
  font-size: 11px;
  padding: 4px 12px;
  border-radius: var(--radius);
  text-decoration: none;
  transition: background var(--transition);
}

.skill-tag:hover {
  background: rgba(255, 140, 0, 0.1);
}

/* ============================================
   Contact Links
   ============================================ */
.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.contact-links a,
.contact-link {
  border: 1px solid var(--text);
  color: var(--text);
  font-size: 11px;
  padding: 4px 12px;
  border-radius: var(--radius);
  text-decoration: none;
  letter-spacing: 1px;
  transition: background var(--transition);
}

.contact-links a:hover,
.contact-link:hover {
  background: rgba(255, 140, 0, 0.1);
}

/* ============================================
   Experience Cards
   ============================================ */
.exp-card {
  border: 1px solid var(--border);
  padding: 20px 0;
  transition: border-color var(--transition);
}

.exp-card + .exp-card {
  border-top: none;
}

.exp-card:first-child {
  border-top: 1px solid var(--border);
}

.exp-card:last-child {
  border-bottom: 1px solid var(--border);
}

.exp-card:hover {
  border-color: var(--border-hover);
}

.exp-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
}

.exp-company {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 4px;
}

.exp-desc {
  font-size: 16px;
  color: var(--text-muted);
  margin-top: 8px;
  line-height: 1.6;
}

/* ============================================
   Project Cards
   ============================================ */
.projects-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.project-card {
  border: 1px solid var(--border);
  padding: 20px;
  border-radius: var(--radius);
  transition: border-color var(--transition);
}

.project-card:hover {
  border-color: var(--border-hover);
}

.project-name {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}

.project-desc {
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 12px;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.project-link {
  font-size: 12px;
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
}

.project-link:hover {
  text-decoration: underline;
}

/* ============================================
   Blog List
   ============================================ */
.blog-list {
  display: flex;
  flex-direction: column;
}

.blog-item {
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
}

.blog-item:first-child {
  border-top: 1px solid var(--border);
}

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

.blog-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  display: block;
  margin-bottom: 6px;
}

.blog-title:hover {
  text-decoration: underline;
}

.blog-meta {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 6px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.blog-tag {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 11px;
}

.blog-tag:hover {
  color: var(--text);
  text-decoration: underline;
}

.blog-summary {
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ============================================
   Tag Filters
   ============================================ */
.tag-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.tag-filter {
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 11px;
  padding: 4px 12px;
  border-radius: var(--radius);
  text-decoration: none;
  transition: border-color var(--transition), color var(--transition);
}

.tag-filter:hover,
.tag-filter.active {
  border-color: var(--text);
  color: var(--text);
}

/* ============================================
   Blog Post
   ============================================ */
.post-back {
  font-size: 12px;
  color: var(--text-muted);
  text-decoration: none;
  letter-spacing: 1px;
  margin-bottom: 24px;
  display: inline-block;
  transition: color var(--transition);
}

.post-back:hover {
  color: var(--text);
}

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

.post-title {
  font-size: 36px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
  letter-spacing: -1px;
  line-height: 1.2;
}

.post-meta {
  font-size: 12px;
  color: var(--text-muted);
}

.post-content {
  font-size: 17px;
  line-height: 1.8;
  color: var(--text);
}

.post-content h1,
.post-content h2,
.post-content h3 {
  font-weight: 700;
  margin: 32px 0 12px;
  letter-spacing: -0.5px;
}

.post-content h2 { font-size: 20px; }
.post-content h3 { font-size: 16px; }

.post-content p { margin-bottom: 16px; }

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

.post-content a:hover { text-decoration: underline; }

.post-content code {
  border: 1px solid var(--border);
  padding: 2px 6px;
  font-size: 12px;
  border-radius: var(--radius);
}

.post-content pre {
  background: var(--bg-surface);
  border: 1px solid rgba(26, 26, 26, 0.1);
  padding: 16px;
  border-radius: var(--radius);
  overflow-x: auto;
  margin-bottom: 16px;
}

.post-content pre code {
  border: none;
  padding: 0;
  font-size: 12px;
  background: none;
}

.post-content ul,
.post-content ol {
  margin: 0 0 16px 24px;
}

.post-content blockquote {
  border-left: 2px solid var(--text);
  padding-left: 16px;
  color: var(--text-muted);
  margin: 16px 0;
}

/* ============================================
   Mobile Menu
   ============================================ */
.mobile-menu-btn {
  display: none;
  margin-left: auto;
  background: none;
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--font);
  font-size: 11px;
  padding: 6px 10px;
  cursor: pointer;
  border-radius: var(--radius);
  transition: border-color var(--transition);
}

.mobile-menu-btn:hover {
  border-color: var(--text);
}

.mobile-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(245, 240, 232, 0.95);
  z-index: 99;
}

.mobile-nav {
  position: fixed;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100vh;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  z-index: 101;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: left 200ms ease-out;
}

.mobile-nav.open {
  left: 0;
}

.mobile-nav a {
  font-size: 18px;
  color: var(--text);
  text-decoration: none;
  letter-spacing: 2px;
  padding: 12px 24px;
  transition: opacity var(--transition);
}

.mobile-nav a:hover {
  opacity: 0.7;
}

.mobile-close {
  position: absolute;
  top: 16px;
  right: 20px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: var(--font);
  font-size: 20px;
  cursor: pointer;
  transition: color var(--transition);
}

.mobile-close:hover {
  color: var(--text);
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 768px) {
  .site-nav { display: none; }
  .mobile-menu-btn { display: block; }
  .mobile-overlay { display: block; }

  .site-main {
    padding: 32px 16px;
  }

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

  .projects-grid {
    grid-template-columns: 1fr;
  }

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

  .site-footer {
    display: none;
  }
}
