/* Haoman Future Theme - Main Stylesheet */

/* CSS Variables */
:root {
  --bg-primary: #0a0a0a;
  --bg-secondary: #111111;
  --bg-card: #161616;
  --accent-gold: #d4a853;
  --accent-copper: #c77d3e;
  --text-primary: #f5f5f0;
  --text-secondary: #a8a8a0;
  --text-muted: #666660;
  --border-subtle: #2a2a28;
  --gradient-glow: linear-gradient(135deg, rgba(212,168,83,0.15) 0%, rgba(199,125,62,0.08) 100%);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.8;
  overflow-x: hidden;
}

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

h1, h2, h3, h4, h5, h6 {
  font-family: 'Noto Serif SC', 'Source Serif Pro', Georgia, serif;
  font-weight: 600;
  letter-spacing: 0.02em;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.3s ease;
}

/* ============================================
   Navigation
   ============================================ */
.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 1.5rem 3rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(to bottom, rgba(10,10,10,0.95) 0%, transparent 100%);
  backdrop-filter: blur(10px);
}

.site-logo {
  font-family: 'Noto Serif SC', serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  text-decoration: none;
  position: relative;
}

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

.site-logo:hover::after {
  width: 100%;
}

.nav-links {
  display: flex;
  gap: 2.5rem;
  list-style: none;
}

.nav-links li,
.nav-links a {
  color: var(--text-secondary);
  font-size: 0.9rem;
  transition: color 0.3s ease;
  cursor: pointer;
}

.nav-links a:hover,
.nav-links li:hover {
  color: var(--accent-gold);
}

/* ============================================
   Hero Section
   ============================================ */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 8rem 2rem 4rem;
}

.hero-content {
  max-width: 900px;
  text-align: center;
  position: relative;
}

.hero-tag {
  display: inline-block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.3em;
  color: var(--accent-gold);
  margin-bottom: 2rem;
  opacity: 0;
  animation: fadeSlideUp 0.8s ease-out 0.2s forwards;
}

.hero-title {
  font-size: clamp(2.5rem, 8vw, 5rem);
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 1.5rem;
  opacity: 0;
  animation: fadeSlideUp 0.8s ease-out 0.4s forwards;
}

.hero-title span {
  display: block;
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--text-secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 3rem;
  font-weight: 300;
  opacity: 0;
  animation: fadeSlideUp 0.8s ease-out 0.6s forwards;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 2rem;
  background: transparent;
  border: 1px solid var(--accent-gold);
  color: var(--accent-gold);
  font-size: 0.9rem;
  letter-spacing: 0.1em;
  transition: all 0.4s ease;
  opacity: 0;
  animation: fadeSlideUp 0.8s ease-out 0.8s forwards;
  cursor: pointer;
}

.hero-cta:hover {
  background: var(--accent-gold);
  color: var(--bg-primary);
}

.hero-cta svg {
  width: 16px;
  height: 16px;
  transition: transform 0.3s ease;
}

.hero-cta:hover svg {
  transform: translateX(4px);
}

/* Decorative circles */
.hero-deco {
  position: absolute;
  width: 400px;
  height: 400px;
  border: 1px solid var(--border-subtle);
  border-radius: 50%;
  opacity: 0.3;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.hero-deco::before {
  content: '';
  position: absolute;
  width: 300px;
  height: 300px;
  border: 1px solid var(--accent-gold);
  border-radius: 50%;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  opacity: 0.2;
}

/* Scroll indicator */
.scroll-indicator {
  position: absolute;
  bottom: 3rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  opacity: 0;
  animation: fadeSlideUp 0.8s ease-out 1s forwards;
}

.scroll-indicator::after {
  content: '';
  width: 1px;
  height: 40px;
  background: linear-gradient(to bottom, var(--accent-gold), transparent);
  animation: scrollPulse 2s ease-in-out infinite;
}

/* ============================================
   Sections
   ============================================ */
section {
  padding: 6rem 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.section-header {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 4rem;
}

.section-number {
  font-family: 'Noto Serif SC', serif;
  font-size: 4rem;
  font-weight: 700;
  color: var(--bg-secondary);
  -webkit-text-stroke: 1px var(--border-subtle);
  line-height: 1;
}

.section-title {
  font-size: 1.8rem;
  color: var(--text-primary);
}

.section-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, var(--border-subtle), transparent);
}

/* ============================================
   Article Cards
   ============================================ */
.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 2rem;
}

.article-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  padding: 2rem;
  position: relative;
  transition: all 0.4s ease;
  cursor: pointer;
  opacity: 0;
  transform: translateY(30px);
}

.article-card.visible {
  opacity: 1;
  transform: translateY(0);
}

.article-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--gradient-glow);
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.article-card:hover {
  transform: translateY(-8px);
  border-color: var(--accent-gold);
}

.article-card:hover::before {
  opacity: 1;
}

.article-tag {
  display: inline-block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--accent-gold);
  padding: 0.4rem 0.8rem;
  border: 1px solid var(--accent-gold);
  margin-bottom: 1.5rem;
}

.article-title {
  font-size: 1.4rem;
  margin-bottom: 1rem;
  line-height: 1.4;
  transition: color 0.3s ease;
  display: block;
}

.article-card:hover .article-title,
.article-card:focus .article-title {
  color: var(--accent-gold);
}

.article-excerpt {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.7;
  margin-bottom: 1.5rem;
}

.article-meta {
  display: flex;
  gap: 1.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.article-meta span {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* ============================================
   Featured Article
   ============================================ */
.featured-article {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 4rem;
  align-items: center;
  padding: 4rem 0;
  border-bottom: 1px solid var(--border-subtle);
  opacity: 0;
  transform: translateY(30px);
  cursor: pointer;
  transition: all 0.4s ease;
}

.featured-article.visible {
  opacity: 1;
  transform: translateY(0);
}

.featured-article:hover .article-title {
  color: var(--accent-gold);
}

.featured-image {
  aspect-ratio: 16/10;
  background: var(--bg-secondary);
  position: relative;
  overflow: hidden;
}

.featured-image::after {
  content: 'Featured';
  position: absolute;
  top: 1.5rem;
  left: 1.5rem;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--bg-primary);
  background: var(--accent-gold);
  padding: 0.5rem 1rem;
}

.featured-image-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-card) 100%);
}

.featured-image-placeholder svg {
  width: 60px;
  height: 60px;
  color: var(--border-subtle);
}

.featured-content {
  padding: 2rem 0;
}

.featured-content .article-title {
  font-size: 2rem;
  margin-bottom: 1.5rem;
}

.featured-content .article-excerpt {
  font-size: 1rem;
  margin-bottom: 2rem;
}

/* ============================================
   About Section
   ============================================ */
.about-section {
  background: var(--bg-secondary);
  padding: 6rem 2rem;
  margin: 4rem 0;
  position: relative;
}

.about-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--accent-gold), transparent);
}

.about-content {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 6rem;
  align-items: center;
}

.about-avatar {
  width: 280px;
  height: 280px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  position: relative;
}

.about-avatar::before {
  content: '';
  position: absolute;
  top: 12px;
  left: 12px;
  width: 100%;
  height: 100%;
  border: 1px solid var(--accent-gold);
  opacity: 0.3;
}

.about-avatar-inner {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Noto Serif SC', serif;
  font-size: 4rem;
  color: var(--text-muted);
  background: var(--bg-primary);
}

.about-text h2 {
  font-size: 2.5rem;
  margin-bottom: 1.5rem;
}

.about-text p {
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.9;
  margin-bottom: 1.5rem;
}

.about-text .highlight {
  color: var(--accent-gold);
  font-weight: 500;
}

.about-skills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2rem;
}

.skill-tag {
  padding: 0.5rem 1rem;
  border: 1px solid var(--border-subtle);
  font-size: 0.85rem;
  color: var(--text-secondary);
  transition: all 0.3s ease;
  cursor: pointer;
}

.skill-tag:hover {
  border-color: var(--accent-gold);
  color: var(--accent-gold);
}

/* ============================================
   Post Detail Page
   ============================================ */
.post-detail {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 2rem;
}

.post-header {
  text-align: center;
  padding: 8rem 0 4rem;
  opacity: 0;
  animation: fadeSlideUp 0.8s ease-out 0.2s forwards;
}

.post-header .article-title {
  font-size: clamp(2rem, 5vw, 3.5rem);
  line-height: 1.3;
  margin-bottom: 2rem;
}

.post-header .article-meta {
  justify-content: center;
  gap: 2rem;
}

.post-cover {
  aspect-ratio: 21/9;
  background: var(--bg-secondary);
  margin-bottom: 4rem;
  opacity: 0;
  animation: fadeSlideUp 0.8s ease-out 0.4s forwards;
  display: flex;
  align-items: center;
  justify-content: center;
}

.post-cover svg {
  width: 80px;
  height: 80px;
  color: var(--border-subtle);
}

.post-body {
  opacity: 0;
  animation: fadeSlideUp 0.8s ease-out 0.6s forwards;
  font-size: 1.05rem;
}

.post-body p {
  line-height: 1.9;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  text-align: justify;
}

.post-body h2 {
  font-size: 1.5rem;
  color: var(--text-primary);
  margin: 2.5rem 0 1.5rem;
  position: relative;
  padding-left: 1.2rem;
}

.post-body h2::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.25rem;
  width: 3px;
  height: 1.3rem;
  background: var(--accent-gold);
}

.post-body h3 {
  font-size: 1.2rem;
  color: var(--text-primary);
  margin: 2rem 0 1rem;
}

.post-body ul,
.post-body ol {
  margin: 1.5rem 0 2rem 1.5rem;
  color: var(--text-secondary);
}

.post-body li {
  margin-bottom: 1rem;
  line-height: 1.8;
}

.post-body code {
  font-family: 'SF Mono', 'Fira Code', 'Menlo', monospace;
  background: var(--bg-card);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.9em;
  color: var(--accent-gold);
}

.post-body pre {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  padding: 0;
  margin: 2rem 0;
  overflow-x: auto;
  border-radius: 4px;
  position: relative;
}

.post-body pre code {
  background: none;
  padding: 1.5rem;
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--text-secondary);
  display: block;
}

.post-body blockquote {
  border-left: 3px solid var(--accent-gold);
  padding-left: 1.5rem;
  margin: 2rem 0;
  font-style: italic;
  color: var(--text-muted);
}

.post-body .image-wrapper {
  margin: 2rem 0;
  text-align: center;
}

.post-body img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  display: inline-block;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

/* Code block with copy button */
.code-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 1rem;
  background: rgba(212,168,83,0.1);
  border-bottom: 1px solid var(--border-subtle);
}

.code-lang {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.copy-btn {
  background: none;
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  padding: 0.3rem 0.8rem;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.3s ease;
  border-radius: 3px;
}

.copy-btn:hover {
  border-color: var(--accent-gold);
  color: var(--accent-gold);
}

.copy-btn.copied {
  border-color: #4CAF50;
  color: #4CAF50;
}

.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-subtle);
}

.post-tags span {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.tag {
  padding: 0.4rem 1rem;
  border: 1px solid var(--border-subtle);
  font-size: 0.85rem;
  color: var(--text-secondary);
  transition: all 0.3s ease;
  cursor: pointer;
}

.tag:hover {
  border-color: var(--accent-gold);
  color: var(--accent-gold);
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
  padding: 0.8rem 1.5rem;
  border: 1px solid var(--border-subtle);
  transition: all 0.3s ease;
  margin: 6rem 0 2rem 0;
  cursor: pointer;
}

.back-link:hover {
  border-color: var(--accent-gold);
  color: var(--accent-gold);
}

.back-link svg {
  width: 16px;
  height: 16px;
  transition: transform 0.3s ease;
}

.back-link:hover svg {
  transform: translateX(-4px);
}

/* ============================================
   Related Articles
   ============================================ */
.related-articles {
  background: var(--bg-secondary);
  padding: 4rem 2rem;
  margin-top: 4rem;
}

.related-header {
  max-width: 1200px;
  margin: 0 auto 3rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.related-header h2 {
  font-size: 1.5rem;
}

.related-header::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-subtle);
}

.related-grid {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.related-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  padding: 1.5rem;
  transition: all 0.4s ease;
  cursor: pointer;
}

.related-card:hover {
  border-color: var(--accent-gold);
  transform: translateY(-4px);
}

.related-card h4 {
  color: var(--text-primary);
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
  transition: color 0.3s ease;
}

.related-card:hover h4 {
  color: var(--accent-gold);
}

.related-card p {
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ============================================
   Footer
   ============================================ */
.site-footer {
  padding: 4rem 2rem;
  border-top: 1px solid var(--border-subtle);
  text-align: center;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
}

.social-links {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-bottom: 2rem;
}

.social-links a {
  color: var(--text-muted);
  transition: color 0.3s ease;
  display: inline-flex;
}

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

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

/* ============================================
   Animations
   ============================================ */
@keyframes fadeSlideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes scrollPulse {
  0%, 100% {
    opacity: 0.3;
    transform: translateY(0);
  }
  50% {
    opacity: 1;
    transform: translateY(10px);
  }
}

/* ============================================
   Archives Page
   ============================================ */
.archive-list {
  padding-top: 8rem;
  max-width: 800px;
  margin: 0 auto;
  padding-left: 2rem;
  padding-right: 2rem;
}

.archive-year {
  margin-bottom: 3rem;
}

.archive-year h2 {
  font-size: 1.5rem;
  color: var(--accent-gold);
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-subtle);
}

.archive-item {
  display: flex;
  align-items: baseline;
  gap: 1.5rem;
  padding: 0.75rem 0;
  transition: color 0.3s ease;
}

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

.archive-date {
  font-size: 0.9rem;
  color: var(--text-muted);
  min-width: 100px;
}

.archive-title {
  font-size: 1rem;
  color: var(--text-secondary);
  transition: color 0.3s ease;
}

/* ============================================
   Tags Page
   ============================================ */
.tags-cloud {
  padding-top: 8rem;
  text-align: center;
  padding-left: 2rem;
  padding-right: 2rem;
}

.tags-cloud h1 {
  font-size: 2rem;
  margin-bottom: 3rem;
}

.tags-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  max-width: 800px;
  margin: 0 auto;
}

.tags-list a {
  padding: 0.5rem 1.5rem;
  border: 1px solid var(--border-subtle);
  font-size: 1rem;
  color: var(--text-secondary);
  transition: all 0.3s ease;
}

.tags-list a:hover {
  border-color: var(--accent-gold);
  color: var(--accent-gold);
}

/* ============================================
   Responsive Design
   ============================================ */
@media (max-width: 900px) {
  .site-nav {
    padding: 1rem 1.5rem;
  }

  .nav-links {
    display: none;
  }

  .hero {
    padding: 6rem 1.5rem 3rem;
  }

  .featured-article {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .about-content {
    grid-template-columns: 1fr;
    gap: 3rem;
    text-align: center;
  }

  .about-avatar {
    margin: 0 auto;
  }

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

  .post-header .article-meta {
    flex-direction: column;
    gap: 0.75rem;
  }

  .archive-item {
    flex-direction: column;
    gap: 0.5rem;
  }

  .archive-date {
    min-width: auto;
  }
}

/* ============================================
   Mobile Menu (for future enhancement)
   ============================================ */
.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.mobile-menu-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  margin: 5px 0;
  transition: all 0.3s ease;
}

@media (max-width: 900px) {
  .mobile-menu-toggle {
    display: block;
  }
}