@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@400;500;600;700&family=Noto+Sans+Mono:wght@400;500&display=swap');

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  font-family: "Noto Sans SC", system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background-color: #FFFFFF;
  color: #1F2937;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

body.menu-open {
  overflow: hidden;
}

main {
  flex: 1;
}

a {
  color: #2563EB;
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: #1D4ED8;
  text-decoration: none;
}

/* ============================================
   HEADER - Mobile Responsive Navigation
   ============================================ */

.site-header {
  background-color: #FFFFFF;
  border-bottom: 1px solid #E5E7EB;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(8px);
  background: rgba(255, 255, 255, 0.95);
}

.header-container {
  max-width: 1024px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  z-index: 101;
}

.logo-icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.625rem;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.logo:hover .logo-icon {
  transform: scale(1.08);
}

.logo-text {
  font-size: 1.125rem;
  font-weight: 600;
  color: #111827;
  letter-spacing: -0.01em;
}

/* Mobile Menu Toggle - Hamburger */
.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0.5rem;
  background: transparent;
  border: none;
  cursor: pointer;
  z-index: 101;
  border-radius: 0.5rem;
  transition: background-color 0.2s ease;
}

.mobile-menu-toggle:hover {
  background-color: #F3F4F6;
}

.mobile-menu-toggle:focus {
  outline: 2px solid #2563EB;
  outline-offset: 2px;
}

.hamburger-line {
  display: block;
  width: 1.25rem;
  height: 2px;
  background-color: #374151;
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.hamburger-line:nth-child(1) {
  margin-bottom: 4px;
}

.hamburger-line:nth-child(3) {
  margin-top: 4px;
}

.mobile-menu-toggle.is-active .hamburger-line:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.mobile-menu-toggle.is-active .hamburger-line:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.mobile-menu-toggle.is-active .hamburger-line:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

/* Main Navigation */
.main-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nav-link {
  color: #6B7280;
  font-size: 0.9375rem;
  font-weight: 500;
  padding: 0.5rem 0.75rem;
  border-radius: 0.375rem;
  transition: color 0.2s ease, background-color 0.2s ease;
}

.nav-link:hover {
  color: #111827;
  background-color: #F3F4F6;
  text-decoration: none;
}

.nav-divider {
  color: #D1D5DB;
}

.nav-tagline {
  color: #9CA3AF;
  font-size: 0.875rem;
}

/* ============================================
   PAGE CONTAINER & LAYOUT
   ============================================ */

.page-container {
  max-width: 1024px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.container {
  max-width: 1024px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.py-8 {
  padding-top: 3rem;
  padding-bottom: 3rem;
}

.mb-8 {
  margin-bottom: 3rem;
}

/* ============================================
   HERO SECTION - Homepage
   ============================================ */

.hero {
  padding: 3.5rem 0 2.5rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -25%;
  width: 150%;
  height: 200%;
  background: radial-gradient(ellipse at center, rgba(37, 99, 235, 0.03) 0%, transparent 60%);
  pointer-events: none;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.875rem;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.08), rgba(124, 58, 237, 0.08));
  border: 1px solid rgba(37, 99, 235, 0.15);
  border-radius: 2rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #2563EB;
  margin-bottom: 1.25rem;
  animation: fadeInDown 0.6s ease-out;
}

.hero-eyebrow-dot {
  width: 6px;
  height: 6px;
  background: #2563EB;
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(1.2); }
}

.hero-title {
  font-size: clamp(1.75rem, 5vw, 2.5rem);
  font-weight: 700;
  color: #111827;
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin: 0 0 1rem 0;
  animation: fadeInUp 0.6s ease-out 0.1s both;
}

.hero-subtitle {
  font-size: clamp(0.9375rem, 2.5vw, 1.0625rem);
  color: #6B7280;
  max-width: 32rem;
  margin: 0 auto;
  line-height: 1.6;
  animation: fadeInUp 0.6s ease-out 0.2s both;
}

/* ============================================
   ARTICLE CARDS
   ============================================ */

.articles-grid {
  display: grid;
  gap: 1rem;
}

.article-card {
  display: block;
  background-color: #FFFFFF;
  border: 1px solid #E5E7EB;
  border-radius: 1rem;
  padding: 1.5rem;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
  text-decoration: none;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  position: relative;
  overflow: hidden;
  animation: fadeInUp 0.5s ease-out both;
}

.article-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #2563EB, #7C3AED);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.article-card:hover {
  border-color: rgba(37, 99, 235, 0.3);
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.1), 0 2px 8px rgba(0, 0, 0, 0.04);
  transform: translateY(-2px);
}

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

.card-inner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.card-content {
  flex: 1;
  min-width: 0;
}

.article-card h2 {
  font-size: 1.125rem;
  font-weight: 600;
  color: #111827;
  margin: 0 0 0.5rem 0;
  line-height: 1.4;
  transition: color 0.2s ease;
}

.article-card:hover h2 {
  color: #2563EB;
}

.article-card p {
  color: #6B7280;
  font-size: 0.875rem;
  line-height: 1.6;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.arrow-link {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  color: #9CA3AF;
  font-size: 0.875rem;
  font-weight: 500;
  transition: color 0.2s ease, gap 0.2s ease;
  flex-shrink: 0;
  padding-top: 0.25rem;
}

.arrow-link svg {
  width: 1rem;
  height: 1rem;
  transition: transform 0.2s ease;
}

.article-card:hover .arrow-link {
  color: #2563EB;
  gap: 0.5rem;
}

.article-card:hover .arrow-link svg {
  transform: translateX(2px);
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #F3F4F6;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  color: #9CA3AF;
  font-size: 0.8125rem;
}

.meta-item svg {
  width: 0.875rem;
  height: 0.875rem;
  opacity: 0.7;
}

/* Staggered animation for cards */
.article-card:nth-child(1) { animation-delay: 0.1s; }
.article-card:nth-child(2) { animation-delay: 0.15s; }
.article-card:nth-child(3) { animation-delay: 0.2s; }
.article-card:nth-child(4) { animation-delay: 0.25s; }
.article-card:nth-child(5) { animation-delay: 0.3s; }
.article-card:nth-child(6) { animation-delay: 0.35s; }

/* ============================================
   ARTICLE PAGE
   ============================================ */

.article-header {
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid #E5E7EB;
  animation: fadeInUp 0.5s ease-out;
}

.article-title {
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  font-weight: 700;
  color: #111827;
  margin: 0 0 1rem 0;
  line-height: 1.25;
  letter-spacing: -0.025em;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: #6B7280;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.5rem 0.75rem;
  margin-left: -0.75rem;
  border-radius: 0.5rem;
  transition: color 0.2s ease, background-color 0.2s ease;
}

.back-link:hover {
  color: #2563EB;
  background-color: #F3F4F6;
}

.back-link svg {
  width: 1rem;
  height: 1rem;
  transition: transform 0.2s ease;
}

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

/* Prose / Article Content */
.prose-custom {
  max-width: none;
  color: #374151;
  font-size: 1rem;
  line-height: 1.8;
  animation: fadeInUp 0.5s ease-out 0.1s both;
}

.prose-custom > *:first-child {
  margin-top: 0;
}

.prose-custom h1 {
  font-size: 1.875rem;
  font-weight: 700;
  color: #111827;
  margin: 2.5rem 0 1.5rem;
  letter-spacing: -0.025em;
}

.prose-custom h2 {
  font-size: 1.375rem;
  font-weight: 600;
  color: #111827;
  margin: 2.5rem 0 1rem;
  letter-spacing: -0.02em;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #E5E7EB;
}

.prose-custom h3 {
  font-size: 1.125rem;
  font-weight: 600;
  color: #1F2937;
  margin: 2rem 0 0.75rem;
}

.prose-custom h4 {
  font-size: 1rem;
  font-weight: 600;
  color: #374151;
  margin: 1.5rem 0 0.5rem;
}

.prose-custom p {
  color: #374151;
  line-height: 1.8;
  margin-bottom: 1.25rem;
}

.prose-custom ul, .prose-custom ol {
  margin-bottom: 1.25rem;
  padding-left: 1.5rem;
}

.prose-custom ul {
  list-style-type: disc;
}

.prose-custom ol {
  list-style-type: decimal;
}

.prose-custom li {
  color: #374151;
  margin-bottom: 0.5rem;
  line-height: 1.6;
}

.prose-custom li::marker {
  color: #2563EB;
}

.prose-custom a {
  color: #2563EB;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.2s ease;
}

.prose-custom a:hover {
  color: #1D4ED8;
}

.prose-custom code {
  background-color: #F3F4F6;
  padding: 0.125rem 0.375rem;
  border-radius: 0.25rem;
  font-size: 0.875em;
  font-family: "Noto Sans Mono", monospace;
  color: #1F2937;
}

.prose-custom pre {
  background-color: #1F2937;
  padding: 1.25rem;
  border-radius: 0.75rem;
  overflow-x: auto;
  margin-bottom: 1.5rem;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.prose-custom pre code {
  background: transparent;
  padding: 0;
  color: #E5E7EB;
  font-size: 0.875rem;
  line-height: 1.7;
}

.prose-custom blockquote {
  border-left: 3px solid #2563EB;
  padding-left: 1.25rem;
  font-style: italic;
  color: #6B7280;
  margin: 1.75rem 0;
  padding: 1rem 1.25rem;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.04), rgba(124, 58, 237, 0.04));
  border-radius: 0 0.5rem 0.5rem 0;
}

.prose-custom strong {
  color: #111827;
  font-weight: 600;
}

.prose-custom em {
  font-style: italic;
}

.prose-custom hr {
  border: none;
  height: 1px;
  background: linear-gradient(90deg, transparent, #E5E7EB, transparent);
  margin: 3rem 0;
}

.prose-custom table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
  font-size: 0.875rem;
  border-radius: 0.5rem;
  overflow: hidden;
  border: 1px solid #E5E7EB;
}

.prose-custom th, .prose-custom td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid #E5E7EB;
}

.prose-custom th {
  font-weight: 600;
  color: #374151;
  background-color: #F9FAFB;
}

.prose-custom td {
  color: #6B7280;
}

.prose-custom tr:last-child td {
  border-bottom: none;
}

.prose-custom img {
  max-width: 100%;
  height: auto;
  border-radius: 0.75rem;
  margin: 1.75rem 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* ============================================
   FOOTER
   ============================================ */

.site-footer {
  border-top: 1px solid #E5E7EB;
  padding: 2.5rem 0;
  background: linear-gradient(180deg, #F9FAFB 0%, #FFFFFF 100%);
}

.footer-container {
  max-width: 1024px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.875rem;
}

.footer-logo {
  width: 2rem;
  height: 2rem;
  border-radius: 0.5rem;
}

.footer-text {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.footer-name {
  font-size: 0.9375rem;
  font-weight: 600;
  color: #374151;
}

.footer-tagline {
  font-size: 0.8125rem;
  color: #9CA3AF;
}

/* ============================================
   ANIMATIONS
   ============================================ */

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================================
   RESPONSIVE - TABLET (768px - 1024px)
   ============================================ */

@media (max-width: 1024px) {
  .header-container {
    padding: 0 1.25rem;
  }

  .page-container {
    padding: 0 1.25rem;
  }

  .nav-tagline {
    font-size: 0.8125rem;
  }
}

/* ============================================
   RESPONSIVE - MOBILE (<768px)
   ============================================ */

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

  .header-container {
    height: 3.5rem;
    padding: 0 1rem;
  }

  .logo-text {
    font-size: 1rem;
  }

  .logo-icon {
    width: 2.25rem;
    height: 2.25rem;
  }

  /* Mobile Navigation Overlay */
  .main-nav {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 280px;
    max-width: 85vw;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 5rem 1.5rem 2rem;
    background: #FFFFFF;
    box-shadow: -8px 0 24px rgba(0, 0, 0, 0.1);
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 100;
  }

  .main-nav.is-open {
    transform: translateX(0);
  }

  .main-nav .nav-link {
    font-size: 1rem;
    padding: 0.75rem 0;
    width: 100%;
    border-bottom: 1px solid #F3F4F6;
  }

  .main-nav .nav-divider {
    display: none;
  }

  .main-nav .nav-tagline {
    margin-top: 1rem;
    font-size: 0.875rem;
    color: #9CA3AF;
  }

  /* Page container adjustments */
  .page-container {
    padding: 0 1rem;
  }

  /* Hero section */
  .hero {
    padding: 2.5rem 0 2rem;
  }

  .hero-eyebrow {
    font-size: 0.75rem;
    padding: 0.3125rem 0.75rem;
  }

  /* Typography adjustments */
  .mb-8 {
    margin-bottom: 2rem;
  }

  .py-8 {
    padding-top: 2rem;
    padding-bottom: 2rem;
  }

  /* Article cards - stack vertically */
  .articles-grid {
    gap: 0.875rem;
  }

  .article-card {
    padding: 1.25rem;
    border-radius: 0.875rem;
  }

  .article-card h2 {
    font-size: 1.0625rem;
  }

  .card-inner {
    flex-direction: column;
    gap: 0.75rem;
  }

  .arrow-link {
    align-self: flex-start;
  }

  .card-meta {
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 0.875rem;
    padding-top: 0.875rem;
  }

  /* Article page */
  .article-header {
    margin-bottom: 2rem;
    padding-bottom: 1.25rem;
  }

  .prose-custom {
    font-size: 0.9375rem;
    line-height: 1.75;
  }

  .prose-custom h1 {
    font-size: 1.5rem;
    margin: 2rem 0 1rem;
  }

  .prose-custom h2 {
    font-size: 1.25rem;
    margin: 1.75rem 0 0.75rem;
  }

  .prose-custom h3 {
    font-size: 1.0625rem;
    margin: 1.5rem 0 0.5rem;
  }

  .prose-custom pre {
    padding: 1rem;
    border-radius: 0.5rem;
    margin-left: -1rem;
    margin-right: -1rem;
    border-radius: 0;
  }

  .prose-custom blockquote {
    margin-left: 0;
    margin-right: 0;
    border-radius: 0 0.5rem 0.5rem 0;
  }

  /* Footer */
  .site-footer {
    padding: 2rem 0;
  }

  .footer-container {
    padding: 0 1rem;
    text-align: center;
  }

  .footer-brand {
    flex-direction: column;
    gap: 0.75rem;
  }

  .footer-text {
    align-items: center;
  }
}

/* ============================================
   RESPONSIVE - SMALL MOBILE (<480px)
   ============================================ */

@media (max-width: 480px) {
  .header-container {
    padding: 0 0.875rem;
  }

  .page-container {
    padding: 0 0.875rem;
  }

  .hero {
    padding: 2rem 0 1.5rem;
  }

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

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

  .article-card {
    padding: 1.125rem;
  }

  .article-card h2 {
    font-size: 1rem;
  }

  .article-card p {
    font-size: 0.8125rem;
    -webkit-line-clamp: 2;
  }

  .arrow-link {
    font-size: 0.8125rem;
  }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

.text-3xl {
  font-size: 1.875rem;
  line-height: 1.2;
  font-weight: 700;
  color: #111827;
  letter-spacing: -0.025em;
}

.font-bold {
  font-weight: 700;
}

.text-white {
  color: #FFFFFF;
}

.mb-2 {
  margin-bottom: 0.5rem;
}

.text-gray-400 {
  color: #6B7280;
}

.text-gray-500 {
  color: #9CA3AF;
}

.text-xl {
  font-size: 1.125rem;
}

.font-semibold {
  font-weight: 600;
}

.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.w-4 {
  width: 1rem;
  height: 1rem;
}

.h-4 {
  height: 1rem;
}

.mt-4 {
  margin-top: 1rem;
}

.items-center {
  align-items: center;
}

.items-start {
  align-items: flex-start;
}

.justify-between {
  justify-content: space-between;
}

.gap-2 {
  gap: 0.5rem;
}

.gap-4 {
  gap: 1rem;
}

.flex-1 {
  flex: 1;
}

.text-sm {
  font-size: 0.875rem;
}

.text-xs {
  font-size: 0.75rem;
}

/* ============================================
   ERROR PAGE (404)
   ============================================ */

.error-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  padding: 2rem;
}

.error-content {
  text-align: center;
  max-width: 400px;
}

.error-title {
  font-size: 5rem;
  font-weight: 700;
  color: #2563EB;
  margin: 0 0 1rem;
  line-height: 1;
}

.error-message {
  font-size: 1.25rem;
  color: #6B7280;
  margin: 0 0 2rem;
}

.error-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: #2563EB;
  font-weight: 500;
  transition: color 0.2s ease;
}

.error-link:hover {
  color: #1D4ED8;
}

.error-link svg {
  width: 1.25rem;
  height: 1.25rem;
}