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

/* === Custom Properties === */
:root {
  --bg: #111111;
  --text: #e8e0d4;
  --text-secondary: #999999;
  --accent: #ff9944;
  --tag-bg: #1a1a1a;
  --border: #222222;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* === Base === */
html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

a:hover {
  text-decoration: underline;
}

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

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

/* === Sections === */
.section {
  padding: 48px 0;
  border-bottom: 1px solid var(--border);
}

.section:last-child {
  border-bottom: none;
}

.section-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 16px;
}

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

.site-header-link {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
}

.site-header-link:hover {
  color: var(--accent);
  text-decoration: none;
}

/* === Hero === */
.hero {
  padding: 64px 0 48px;
  border-bottom: 1px solid var(--border);
}

.hero-content {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 16px;
}

.hero-photo {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.hero-name {
  font-size: 1.5rem;
  font-weight: 600;
  color: #f0ebe4;
  margin-bottom: 4px;
}

.hero-tagline {
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.hero-links {
  display: flex;
  gap: 16px;
  margin-top: 12px;
}

.hero-links a {
  font-size: 0.875rem;
}

/* === About === */
.prose {
  color: #cccccc;
  font-size: 0.9375rem;
  line-height: 1.7;
}

/* === Projects === */
.project {
  margin-bottom: 16px;
}

.project:last-child {
  margin-bottom: 0;
}

.project:hover {
  background: rgba(255, 255, 255, 0.03);
  margin-left: -8px;
  margin-right: -8px;
  padding-left: 8px;
  padding-right: 8px;
  border-radius: 4px;
}

.project-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}

.project-name {
  font-weight: 500;
  color: #f0ebe4;
}

.project-name a {
  color: inherit;
}

.project-name a:hover {
  color: var(--accent);
}

.tag {
  background: var(--tag-bg);
  color: var(--accent);
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 0.6875rem;
  white-space: nowrap;
}

.project-desc {
  color: var(--text-secondary);
  font-size: 0.8125rem;
  margin-top: 4px;
}

.project-group-title {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 10px;
  margin-top: 20px;
}

.project-group-title:first-of-type {
  margin-top: 0;
}

/* === CV === */
.cv-subsection {
  margin-bottom: 24px;
}

.cv-subsection:last-child {
  margin-bottom: 0;
}

.cv-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 10px;
}

.cv-entry {
  margin-bottom: 12px;
}

.cv-entry:last-child {
  margin-bottom: 0;
}

.cv-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}

.cv-title {
  font-weight: 500;
  color: #f0ebe4;
}

.cv-title a {
  color: inherit;
}

.cv-title a:hover {
  color: var(--accent);
}

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

.cv-detail {
  color: var(--text-secondary);
  font-size: 0.8125rem;
  margin-top: 2px;
}

.cv-publication {
  color: #cccccc;
  font-size: 0.8125rem;
  margin-bottom: 8px;
  line-height: 1.5;
}

.cv-publication:last-child {
  margin-bottom: 0;
}

.cv-publication .author-highlight {
  color: var(--accent);
}

.skills-group {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 8px;
}

.skills-group:last-child {
  margin-bottom: 0;
}

.skills-group-label {
  font-size: 0.6875rem;
  color: var(--text-secondary);
  white-space: nowrap;
  min-width: 72px;
}

.skills-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.skill-tag {
  background: var(--tag-bg);
  color: var(--text);
  padding: 4px 12px;
  border-radius: 3px;
  font-size: 0.6875rem;
}

.cv-download {
  margin-top: 20px;
}

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

.footer-links {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 8px;
}

.footer-links a {
  font-size: 0.875rem;
}

.footer-copy {
  color: #666666;
  font-size: 0.6875rem;
}

/* === Blog (ready for future use) === */
.post-list {
  list-style: none;
}

.post-item {
  margin-bottom: 24px;
}

.post-date {
  color: var(--text-secondary);
  font-size: 0.8125rem;
}

.post-title a {
  font-weight: 500;
  font-size: 1.125rem;
}

.post-tag {
  background: var(--tag-bg);
  color: var(--accent);
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 0.6875rem;
  white-space: nowrap;
}

.post-summary {
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin-top: 4px;
}

.post-content {
  max-width: 720px;
  margin: 0 auto;
  padding: 48px 24px;
}

.post-content h1 {
  font-size: 1.75rem;
  margin-bottom: 8px;
}

.post-content .post-meta {
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin-bottom: 32px;
}

.post-content p,
.post-content ul,
.post-content ol {
  margin-bottom: 16px;
  line-height: 1.7;
}

.post-content code {
  background: var(--tag-bg);
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 0.875rem;
}

.post-content pre {
  background: var(--tag-bg);
  padding: 16px;
  border-radius: 6px;
  overflow-x: auto;
  margin-bottom: 16px;
}

.post-content pre code {
  background: none;
  padding: 0;
}

.post-content h2 {
  font-size: 1.25rem;
  font-weight: 600;
  color: #f0ebe4;
  margin-top: 40px;
  margin-bottom: 12px;
}

.post-content h3 {
  font-size: 1.0625rem;
  font-weight: 600;
  color: #f0ebe4;
  margin-top: 32px;
  margin-bottom: 8px;
}

.post-content h4 {
  font-size: 0.9375rem;
  font-weight: 600;
  color: #f0ebe4;
  margin-top: 24px;
  margin-bottom: 8px;
}

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

.post-content blockquote p {
  margin-bottom: 0;
}

.post-content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 32px 0;
}

.post-content table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 16px;
  font-size: 0.8125rem;
}

.post-content th {
  text-align: left;
  font-weight: 600;
  color: #f0ebe4;
  padding: 8px 12px;
  border-bottom: 2px solid var(--border);
}

.post-content td {
  padding: 6px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

.post-content tr:last-child td {
  border-bottom: none;
}

.post-content strong {
  color: #f0ebe4;
}

.post-content em {
  color: var(--text-secondary);
}

.post-content img {
  border-radius: 6px;
  margin: 16px 0;
}

.back-link {
  margin-top: 48px;
}

/* === Responsive === */
@media (max-width: 480px) {
  .hero-content {
    gap: 14px;
  }

  .hero-photo {
    width: 48px;
    height: 48px;
  }

  .hero-name {
    font-size: 1.25rem;
  }

  .cv-row {
    flex-direction: column;
    gap: 2px;
  }

  .project-header {
    flex-direction: column;
    gap: 4px;
  }
}
