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

:root {
  --bg-primary: #0a0a0a;
  --bg-secondary: #111111;
  --bg-card: #1a1a1a;
  --text-primary: #f0f0f0;
  --text-secondary: #a0a0a0;
  --accent: #4D9FFF;
  --accent-dim: rgba(77, 159, 255, 0.1);
  --border: #2a2a2a;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  --max-width: 800px;
  --transition: 0.3s ease;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

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

a:hover {
  opacity: 0.8;
}

img {
  max-width: 100%;
  height: auto;
}

/* === Layout === */
.site-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
  width: 100%;
}

/* === Navigation === */
.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(10, 10, 10, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-logo {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.nav-logo:hover {
  color: var(--accent);
  opacity: 1;
}

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

.nav-links a {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color var(--transition);
}

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

/* === Hero Section === */
.hero {
  padding: 10rem 0 5rem;
  min-height: 80vh;
  display: flex;
  align-items: center;
}

.hero-greeting {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  color: var(--accent);
  margin-bottom: 1.25rem;
  font-weight: 400;
}

.hero h1 {
  font-size: 3.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 0.5rem;
}

.hero h2 {
  font-size: 2rem;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: -0.02em;
  margin-bottom: 1.5rem;
  line-height: 1.2;
}

.hero-description {
  max-width: 540px;
  color: var(--text-secondary);
  font-size: 1.05rem;
  line-height: 1.8;
  margin-bottom: 2.5rem;
}

.hero-links {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all var(--transition);
  border: 1px solid var(--accent);
  color: var(--accent);
  background: transparent;
}

.btn:hover {
  background: var(--accent-dim);
  opacity: 1;
}

.btn-filled {
  background: var(--accent);
  color: var(--bg-primary);
}

.btn-filled:hover {
  background: #3A8AE6;
  opacity: 1;
}

/* === Social Links === */
.social-links {
  display: flex;
  gap: 1.25rem;
  margin-top: 2rem;
}

.social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  transition: all var(--transition);
}

.social-link:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-dim);
  opacity: 1;
}

.social-link svg {
  width: 20px;
  height: 20px;
}

/* === Section === */
.section {
  padding: 5rem 0;
}

.section-label {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.75rem;
}

.section-title {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 2rem;
}

.section-divider {
  width: 60px;
  height: 2px;
  background: var(--accent);
  margin-bottom: 3rem;
}

/* === Post List === */
.post-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.post-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 1.25rem 1.5rem;
  border-radius: 8px;
  transition: background var(--transition);
  gap: 1rem;
}

.post-item:hover {
  background: var(--bg-card);
}

.post-item a {
  color: var(--text-primary);
  font-weight: 500;
  font-size: 1.05rem;
}

.post-item a:hover {
  color: var(--accent);
  opacity: 1;
}

.post-date {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-secondary);
  white-space: nowrap;
}

.view-all {
  margin-top: 2rem;
  text-align: center;
}

/* === Page Content === */
.page-header {
  padding: 8rem 0 2rem;
}

.page-header h1 {
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.page-content {
  padding: 2rem 0 5rem;
}

.page-content h1, .page-content h2, .page-content h3 {
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
}

.page-content h1 { font-size: 2rem; }
.page-content h2 { font-size: 1.5rem; }
.page-content h3 { font-size: 1.25rem; color: var(--text-secondary); }

.page-content p {
  margin-bottom: 1.5rem;
  color: var(--text-secondary);
}

.page-content ul, .page-content ol {
  margin-bottom: 1.5rem;
  padding-left: 1.5rem;
  color: var(--text-secondary);
}

.page-content li {
  margin-bottom: 0.5rem;
}

.page-content blockquote {
  border-left: 3px solid var(--accent);
  padding: 1rem 1.5rem;
  margin: 2rem 0;
  background: var(--bg-card);
  border-radius: 0 8px 8px 0;
  color: var(--text-secondary);
  font-style: italic;
}

.page-content code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--bg-card);
  padding: 0.2em 0.4em;
  border-radius: 4px;
  color: var(--accent);
}

.page-content pre {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  overflow-x: auto;
  margin-bottom: 1.5rem;
}

.page-content pre code {
  background: none;
  padding: 0;
  font-size: 0.875rem;
}

.page-content a {
  border-bottom: 1px solid rgba(77, 159, 255, 0.3);
}

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

.page-content img {
  border-radius: 8px;
  margin: 2rem 0;
}

/* === CV === */
.cv-section {
  margin-bottom: 3rem;
}

.cv-section h2 {
  font-size: 1.1rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.cv-entry {
  margin-bottom: 2rem;
}

.cv-entry-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 0.25rem;
}

.cv-entry-header h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.cv-date {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-secondary);
  white-space: nowrap;
}

.cv-org {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
}

.cv-entry ul {
  padding-left: 1.25rem;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.cv-entry li {
  margin-bottom: 0.4rem;
  line-height: 1.6;
}

.cv-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.cv-tag {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  padding: 0.4rem 0.8rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-secondary);
}

@media (max-width: 640px) {
  .cv-entry-header {
    flex-direction: column;
    gap: 0.125rem;
  }
}

/* === Projects === */
.projects-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 2rem;
}

.project-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
}

.project-desc {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 1rem;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.project-embed {
  margin-bottom: 1.25rem;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.project-embed iframe {
  width: 100%;
  height: 500px;
  border: none;
  background: var(--bg-secondary);
}

.project-link {
  display: inline-flex;
}

@media (max-width: 640px) {
  .project-card {
    padding: 1.25rem;
  }

  .project-embed iframe {
    height: 350px;
  }
}

/* === Post Page === */
.post-header {
  padding: 8rem 0 1rem;
}

.post-header h1 {
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.post-meta {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 1rem;
}

.post-content {
  padding: 2rem 0 5rem;
}

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

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

.footer-links {
  display: flex;
  gap: 1.5rem;
  list-style: none;
}

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

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

/* === Responsive === */
@media (max-width: 640px) {
  .hero h1 {
    font-size: 2.25rem;
  }

  .hero h2 {
    font-size: 1.35rem;
  }

  .hero {
    padding: 7rem 0 3rem;
    min-height: auto;
  }

  .nav-links {
    gap: 1.25rem;
  }

  .nav-links a {
    font-size: 0.8rem;
  }

  .post-item {
    flex-direction: column;
    gap: 0.25rem;
    padding: 1rem 1rem;
  }

  .hero-links {
    flex-direction: column;
  }

  .btn {
    justify-content: center;
  }

  .footer-inner {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }

  .section {
    padding: 3rem 0;
  }

}
