/**
 * Qijingzhao Homepage - Main Stylesheet
 * Warm, elegant, humanistic design
 */

/* ========== CSS Variables ========== */
:root {
  /* Color Palette - Warm & Elegant */
  --bg-primary: #FAF8F5;
  --bg-secondary: #F5F1EB;
  --bg-card: #FFFFFF;

  --text-primary: #3D3A38;
  --text-secondary: #6B6560;
  --text-muted: #9A9590;

  --accent-gold: #C9A962;
  --accent-blue: #7BA3B7;
  --accent-green: #8FB39A;
  --accent-rose: #C4A4A4;

  --border-light: rgba(61, 58, 56, 0.1);
  --shadow-soft: 0 4px 20px rgba(61, 58, 56, 0.08);
  --shadow-hover: 0 8px 30px rgba(61, 58, 56, 0.12);

  /* Typography */
  --font-serif: 'Playfair Display', 'Noto Serif SC', Georgia, serif;
  --font-sans: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  /* Spacing */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 2rem;
  --space-lg: 4rem;
  --space-xl: 6rem;

  /* Layout */
  --max-width: 1200px;
  --content-width: 800px;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.8;
  min-height: 100vh;
}

/* ========== Typography ========== */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-primary);
}

h1 { font-size: 3rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

p {
  margin-bottom: var(--space-sm);
}

a {
  color: var(--accent-gold);
  text-decoration: none;
  transition: color 0.3s ease;
}

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

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

.content-narrow {
  max-width: var(--content-width);
  margin: 0 auto;
}

section {
  padding: var(--space-xl) 0;
}

/* ========== Navigation ========== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(250, 248, 245, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-light);
  transition: all 0.3s ease;
}

.navbar.scrolled {
  box-shadow: var(--shadow-soft);
}

.navbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 70px;
}

.nav-logo {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
}

.nav-logo span {
  color: var(--accent-gold);
}

.nav-links {
  display: flex;
  gap: var(--space-md);
  list-style: none;
}

.nav-links a {
  color: var(--text-secondary);
  font-size: 0.95rem;
  padding: var(--space-xs) 0;
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent-gold);
  transition: width 0.3s ease;
}

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

.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}

/* Mobile menu toggle */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 5px;
}

.nav-toggle span {
  width: 25px;
  height: 2px;
  background: var(--text-primary);
  transition: all 0.3s ease;
}

/* ========== Hero Section ========== */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding-top: 70px;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:
    radial-gradient(circle at 20% 50%, rgba(201, 169, 98, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 50%, rgba(123, 163, 183, 0.1) 0%, transparent 50%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
}

.hero h1 {
  font-size: 4rem;
  margin-bottom: var(--space-sm);
  letter-spacing: 0.05em;
}

.hero h1 .highlight {
  color: var(--accent-gold);
}

.hero-subtitle {
  font-size: 1.25rem;
  color: var(--text-secondary);
  margin-bottom: var(--space-md);
  font-family: var(--font-serif);
  font-style: italic;
}

.hero-tags {
  display: flex;
  justify-content: center;
  gap: var(--space-sm);
  flex-wrap: wrap;
  margin-bottom: var(--space-lg);
}

.hero-tag {
  padding: var(--space-xs) var(--space-sm);
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 20px;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.scroll-indicator {
  position: absolute;
  bottom: var(--space-md);
  left: 50%;
  transform: translateX(-50%);
  animation: bounce 2s infinite;
}

.scroll-indicator svg {
  width: 30px;
  height: 30px;
  stroke: var(--text-muted);
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% { transform: translateX(-50%) translateY(0); }
  40% { transform: translateX(-50%) translateY(-10px); }
  60% { transform: translateX(-50%) translateY(-5px); }
}

/* ========== Section Headers ========== */
.section-header {
  text-align: center;
  margin-bottom: var(--space-lg);
}

.section-header h2 {
  display: inline-block;
  position: relative;
  padding-bottom: var(--space-sm);
}

.section-header h2::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-gold), var(--accent-blue));
  border-radius: 2px;
}

.section-header p {
  color: var(--text-secondary);
  margin-top: var(--space-sm);
}

/* ========== Cards Grid ========== */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--space-md);
}

.card {
  background: var(--bg-card);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  transition: all 0.3s ease;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-hover);
}

.card-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  background: var(--bg-secondary);
}

.card-content {
  padding: var(--space-md);
}

.card-category {
  display: inline-block;
  font-size: 0.8rem;
  color: var(--accent-gold);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: var(--space-xs);
}

.card h3 {
  margin-bottom: var(--space-xs);
}

.card p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: var(--space-sm);
}

.card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.card-tags {
  display: flex;
  gap: var(--space-xs);
}

.tag {
  padding: 2px 8px;
  background: var(--bg-secondary);
  border-radius: 4px;
  font-size: 0.8rem;
}

/* ========== About Preview ========== */
.about-preview {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: var(--space-lg);
  align-items: center;
}

.about-image {
  width: 100%;
  max-width: 300px;
  aspect-ratio: 1;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--bg-card);
  box-shadow: var(--shadow-soft);
  margin: 0 auto;
}

.about-image-placeholder {
  width: 100%;
  max-width: 300px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-gold) 0%, var(--accent-blue) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  color: white;
  margin: 0 auto;
  box-shadow: var(--shadow-soft);
}

.about-text h2 {
  margin-bottom: var(--space-sm);
}

.about-text p {
  color: var(--text-secondary);
  margin-bottom: var(--space-md);
}

.btn {
  display: inline-block;
  padding: var(--space-sm) var(--space-md);
  background: var(--accent-gold);
  color: white;
  border-radius: 8px;
  font-weight: 500;
  transition: all 0.3s ease;
}

.btn:hover {
  background: var(--text-primary);
  color: white;
  transform: translateY(-2px);
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--accent-gold);
  color: var(--accent-gold);
}

.btn-outline:hover {
  background: var(--accent-gold);
  color: white;
}

/* ========== Footer ========== */
.footer {
  background: var(--bg-secondary);
  padding: var(--space-lg) 0 var(--space-md);
  margin-top: var(--space-xl);
}

.footer-content {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: var(--space-lg);
}

.footer-brand h3 {
  font-family: var(--font-serif);
  margin-bottom: var(--space-sm);
}

.footer-brand p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.footer-links h4 {
  margin-bottom: var(--space-sm);
  font-size: 1rem;
}

.footer-links ul {
  list-style: none;
}

.footer-links li {
  margin-bottom: var(--space-xs);
}

.footer-links a {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

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

.social-links {
  display: flex;
  gap: var(--space-sm);
  margin-top: var(--space-sm);
}

.social-links a {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  border-radius: 50%;
  color: var(--text-secondary);
  transition: all 0.3s ease;
}

.social-links a:hover {
  background: var(--accent-gold);
  color: white;
}

.footer-bottom {
  text-align: center;
  padding-top: var(--space-md);
  margin-top: var(--space-md);
  border-top: 1px solid var(--border-light);
  color: var(--text-muted);
  font-size: 0.85rem;
}

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

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

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

  h1 { font-size: 2.5rem; }
  .hero h1 { font-size: 2.5rem; }

  .nav-links {
    display: none;
    position: absolute;
    top: 70px;
    left: 0;
    right: 0;
    background: var(--bg-primary);
    flex-direction: column;
    padding: var(--space-md);
    gap: var(--space-sm);
    border-bottom: 1px solid var(--border-light);
  }

  .nav-links.active {
    display: flex;
  }

  .nav-toggle {
    display: flex;
  }

  .about-preview {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .footer-content {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .social-links {
    justify-content: center;
  }
}

/* ========== Blog List ========== */
.blog-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.blog-item {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: var(--space-md);
  padding: var(--space-md);
  background: var(--bg-card);
  border-radius: 12px;
  box-shadow: var(--shadow-soft);
  transition: all 0.3s ease;
}

.blog-item:hover {
  transform: translateX(5px);
  box-shadow: var(--shadow-hover);
}

.blog-item-image {
  width: 100%;
  height: 150px;
  object-fit: cover;
  border-radius: 8px;
  background: var(--bg-secondary);
}

.blog-item-content h3 {
  margin-bottom: var(--space-xs);
}

.blog-item-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: var(--space-xs);
}

@media (max-width: 600px) {
  .blog-item {
    grid-template-columns: 1fr;
  }
}

/* ========== Page Header ========== */
.page-header {
  padding: calc(70px + var(--space-xl)) 0 var(--space-lg);
  background: var(--bg-secondary);
  text-align: center;
}

.page-header h1 {
  margin-bottom: var(--space-sm);
}

.page-header p {
  color: var(--text-secondary);
}

/* ========== Category Filter ========== */
.category-filter {
  display: flex;
  justify-content: center;
  gap: var(--space-sm);
  flex-wrap: wrap;
  margin-bottom: var(--space-lg);
}

.filter-btn {
  padding: var(--space-xs) var(--space-sm);
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.filter-btn:hover,
.filter-btn.active {
  background: var(--accent-gold);
  color: white;
  border-color: var(--accent-gold);
}

/* ========== View Counter ========== */
.view-count {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.view-count svg {
  width: 16px;
  height: 16px;
}
