/* ===== Base & Variables ===== */
:root {
  --bg-primary: #0a1628;
  --bg-secondary: #0f1d32;
  --bg-card: #121f35;
  --accent: #c9a84c;
  --accent-dim: rgba(201, 168, 76, 0.15);
  --text-primary: #e8e6e3;
  --text-secondary: #8a9bb5;
  --text-muted: #5a6a80;
  --border: rgba(201, 168, 76, 0.12);
  --font-cn: 'Noto Sans SC', sans-serif;
  --font-en: 'Space Grotesk', 'JetBrains Mono', monospace;
  --font-mono: 'JetBrains Mono', monospace;
  --max-width: 960px;
  --radius: 10px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-cn);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* Subtle noise texture overlay */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0.03;
  pointer-events: none;
  z-index: 9999;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px 256px;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: opacity 0.2s;
}

a:hover {
  opacity: 0.8;
}

/* ===== Layout ===== */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* ===== Header / Nav ===== */
.site-header {
  padding: 28px 0;
  border-bottom: 1px solid var(--border);
}

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

.site-logo {
  font-family: var(--font-en);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.5px;
}

.site-nav {
  display: flex;
  gap: 28px;
}

.site-nav a {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-family: var(--font-en);
  transition: color 0.2s;
}

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

/* ===== Hero Section ===== */
.hero {
  padding: 100px 0 80px;
  text-align: center;
}

.hero-name {
  font-size: 3.2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
  letter-spacing: 4px;
}

.hero-subtitle {
  font-size: 1.1rem;
  color: var(--text-secondary);
  font-family: var(--font-en);
  margin-bottom: 40px;
}

.hero-bio {
  max-width: 480px;
  margin: 0 auto;
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 2;
}

.hero-bio .accent {
  color: var(--accent);
}

/* ===== Section Titles ===== */
.section-title {
  font-family: var(--font-en);
  font-size: 0.85rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 3px;
  margin-bottom: 32px;
}

/* ===== Projects Grid ===== */
.projects {
  padding: 60px 0 80px;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
  cursor: default;
  position: relative;
  overflow: hidden;
}

.project-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}

.project-card:hover {
  transform: translateY(-3px);
  border-color: rgba(201, 168, 76, 0.25);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

.project-card:hover::after {
  transform: scaleX(1);
}

.project-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
}

.project-card-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.project-card-title a {
  color: inherit;
}

.project-card-title a:hover {
  color: var(--accent);
  opacity: 1;
}

.project-status {
  font-family: var(--font-en);
  font-size: 0.7rem;
  padding: 3px 10px;
  border-radius: 20px;
  letter-spacing: 0.5px;
  white-space: nowrap;
  flex-shrink: 0;
  margin-left: 12px;
}

.status-active {
  color: #4ade80;
  background: rgba(74, 222, 128, 0.1);
  border: 1px solid rgba(74, 222, 128, 0.2);
}

.status-private {
  color: #f472b6;
  background: rgba(244, 114, 182, 0.1);
  border: 1px solid rgba(244, 114, 182, 0.2);
}

.status-coming {
  color: #60a5fa;
  background: rgba(96, 165, 250, 0.1);
  border: 1px solid rgba(96, 165, 250, 0.2);
}

.status-thinking {
  color: var(--text-muted);
  background: rgba(90, 106, 128, 0.1);
  border: 1px solid rgba(90, 106, 128, 0.2);
}

.project-card-desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ===== Footer ===== */
.site-footer {
  padding: 32px 0;
  border-top: 1px solid var(--border);
}

.site-footer .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-left {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.footer-right a {
  color: var(--text-muted);
  transition: color 0.2s;
}

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

.footer-right svg {
  width: 20px;
  height: 20px;
  vertical-align: middle;
}

/* ===== Blog Page ===== */
.blog-page {
  padding: 60px 0 80px;
}

.blog-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.blog-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
  transition: padding-left 0.2s ease;
}

.blog-item:hover {
  padding-left: 8px;
}

.blog-item-title {
  font-size: 1.05rem;
  color: var(--text-primary);
  transition: color 0.2s;
}

.blog-item:hover .blog-item-title {
  color: var(--accent);
}

.blog-item-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
  margin-left: 20px;
}

.blog-item-date {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.blog-tag {
  font-size: 0.72rem;
  color: var(--accent);
  background: var(--accent-dim);
  padding: 2px 8px;
  border-radius: 4px;
}

/* Blog empty state */
.blog-empty {
  text-align: center;
  padding: 80px 0;
  color: var(--text-muted);
}

.blog-empty-icon {
  font-size: 2rem;
  margin-bottom: 16px;
  opacity: 0.5;
}

.blog-empty p {
  font-size: 0.95rem;
}

/* ===== Article Page ===== */
.article-page {
  padding: 60px 0 80px;
}

.article-header {
  margin-bottom: 48px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--border);
}

.article-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 12px;
  line-height: 1.4;
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.article-back {
  display: inline-block;
  margin-bottom: 32px;
  color: var(--text-muted);
  font-size: 0.88rem;
  font-family: var(--font-en);
}

.article-back:hover {
  color: var(--accent);
  opacity: 1;
}

/* Markdown Content Styling */
.article-content {
  font-size: 0.95rem;
  line-height: 1.9;
  color: var(--text-secondary);
}

.article-content h1,
.article-content h2,
.article-content h3 {
  color: var(--text-primary);
  margin-top: 2em;
  margin-bottom: 0.8em;
  line-height: 1.4;
}

.article-content h1 { font-size: 1.6rem; }
.article-content h2 { font-size: 1.3rem; }
.article-content h3 { font-size: 1.1rem; }

.article-content p {
  margin-bottom: 1.2em;
}

.article-content a {
  color: var(--accent);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}

.article-content a:hover {
  border-bottom-color: var(--accent);
  opacity: 1;
}

.article-content code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--bg-secondary);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--accent);
}

.article-content pre {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  overflow-x: auto;
  margin: 1.5em 0;
}

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

.article-content blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 16px;
  margin: 1.5em 0;
  color: var(--text-muted);
  font-style: italic;
}

.article-content ul,
.article-content ol {
  padding-left: 1.5em;
  margin-bottom: 1.2em;
}

.article-content li {
  margin-bottom: 0.4em;
}

.article-content img {
  max-width: 100%;
  border-radius: var(--radius);
  margin: 1.5em 0;
}

.article-content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2em 0;
}

/* ===== Fade-in Animations ===== */
.fade-in {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger animation delays */
.fade-in-delay-1 { transition-delay: 0.1s; }
.fade-in-delay-2 { transition-delay: 0.2s; }
.fade-in-delay-3 { transition-delay: 0.3s; }
.fade-in-delay-4 { transition-delay: 0.4s; }
.fade-in-delay-5 { transition-delay: 0.5s; }
.fade-in-delay-6 { transition-delay: 0.6s; }

/* ===== Loading ===== */
.loading {
  text-align: center;
  padding: 40px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ===== Responsive ===== */
@media (max-width: 640px) {
  .hero {
    padding: 64px 0 56px;
  }

  .hero-name {
    font-size: 2.2rem;
    letter-spacing: 2px;
  }

  .hero-subtitle {
    font-size: 0.95rem;
  }

  .hero-bio {
    font-size: 0.88rem;
  }

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

  .project-card {
    padding: 22px;
  }

  .blog-item {
    flex-direction: column;
    gap: 6px;
  }

  .blog-item-meta {
    margin-left: 0;
  }

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

  .site-footer .container {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }
}
