:root {
  --bg: #0f0f0f;
  --text: #e8e8e8;
  --text-muted: #888888;
  --accent: #7a9cc6;
  --border: #1f1f1f;
  --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

[data-theme="light"] {
  --bg: #fafafa;
  --text: #1a1a1a;
  --text-muted: #666666;
  --accent: #4a7aa8;
  --border: #e0e0e0;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

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

body {
  font-family: var(--font-primary);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  transition: background 0.2s, color 0.2s;
  min-height: 100vh;
}

.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 2rem;
  z-index: 10;
}

.mark {
  font-family: var(--font-primary);
  font-weight: 600;
  font-size: 1.125rem;
  color: var(--text);
  letter-spacing: -0.02em;
}

.theme-toggle {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
}

.theme-toggle:hover {
  color: var(--text);
}

[data-theme="dark"] .icon-moon { display: none; }
[data-theme="light"] .icon-sun { display: none; }

.content {
  max-width: 680px;
  margin: 0 auto;
  padding: 8rem 2rem 6rem;
}

.section {
  margin-bottom: 5rem;
}

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

.statement {
  font-size: 1.25rem;
  font-weight: 400;
  line-height: 1.7;
  color: var(--text);
  max-width: 560px;
}

.project-list,
.writing-list {
  list-style: none;
}

.project-group-label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  padding: 1.25rem 0 0.4rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
}

.status-dot--done { background: #a6e3a1; }
.status-dot--wip { background: #f9e2af; }
.status-dot--planned { background: var(--text-muted); }

[data-theme="light"] .status-dot--done { background: #40a02b; }
[data-theme="light"] .status-dot--wip { background: #df8e1d; }

.project-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
  transition: border-color 0.2s;
}

.project-item:first-child {
  border-top: 1px solid var(--border);
}

.project-item:hover {
  border-color: var(--accent);
}

.project-item:hover + .project-item {
  border-top-color: var(--accent);
}

.project-main {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
}

.project-title {
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--text);
}

.project-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.project-tag {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--accent);
  white-space: nowrap;
}

.project-status {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  min-width: 3.5rem;
  text-align: center;
  flex-shrink: 0;
}

.status--done {
  color: #a6e3a1;
  border: 1px solid #a6e3a133;
}

.status--wip {
  color: #f9e2af;
  border: 1px solid #f9e2af33;
}

.status--planned {
  color: var(--text-muted);
  border: 1px solid var(--border);
}

[data-theme="light"] .status--done {
  color: #40a02b;
  border: 1px solid #40a02b33;
}

[data-theme="light"] .status--wip {
  color: #df8e1d;
  border: 1px solid #df8e1d33;
}

.writing-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
}

.writing-item:first-child {
  border-top: 1px solid var(--border);
}

.writing-link {
  font-size: 0.95rem;
  color: var(--text);
  text-decoration: none;
  transition: color 0.2s;
}

.writing-link:hover {
  color: var(--accent);
}

.writing-date {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.about-text {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.7;
  max-width: 520px;
}

/* Load animation */
[data-reveal] {
  opacity: 0;
  transform: translateY(8px);
  animation: reveal 0.6s ease forwards;
}

.section:nth-child(1) { animation-delay: 0ms; }
.section:nth-child(2) { animation-delay: 100ms; }
.section:nth-child(3) { animation-delay: 200ms; }
.section:nth-child(4) { animation-delay: 300ms; }

@keyframes reveal {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Post page */
.back-link {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  text-decoration: none;
  margin-bottom: 2rem;
  transition: color 0.2s;
}

.back-link:hover {
  color: var(--text);
}

.post h1 {
  font-size: 1.5rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.post h2 {
  font-size: 1.2rem;
  font-weight: 500;
  margin-top: 2rem;
  margin-bottom: 0.5rem;
}

.post p {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.8;
  margin-bottom: 1rem;
}

.post code {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  background: var(--border);
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
}

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

/* Responsive */
@media (max-width: 600px) {
  .header {
    padding: 1rem 1.25rem;
  }

  .content {
    padding: 6rem 1.25rem 4rem;
  }

  .statement {
    font-size: 1.1rem;
  }

  .project-item {
    flex-direction: column;
    gap: 0.25rem;
  }

  .project-tag {
    align-self: flex-start;
  }

  .section {
    margin-bottom: 4rem;
  }
}
