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

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

:root {
  --bg: #1f1b17;
  --text: #d4c6b0;
  --text-secondary: #9a8e7a;
  --accent: #332d26;
  --link: #d4c6b0;
  --link-hover: #e8c87a;
  --code-bg: #2a2420;
  --code-block-bg: #161210;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

::selection {
  background: var(--text);
  color: var(--bg);
}

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

a:hover {
  color: var(--link-hover);
}

/* Layout */
.container {
  max-width: 620px;
  width: 100%;
  margin-left: clamp(24px, 12vw, 260px);
  padding: 0 24px;
}

@media (max-width: 768px) {
  .container {
    margin-left: auto;
    margin-right: auto;
  }
}

/* Navigation */
nav {
  padding: 48px 0 40px;
}

nav ul {
  list-style: none;
  display: flex;
  gap: 20px;
  align-items: center;
}

nav a {
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: lowercase;
  padding-bottom: 2px;
  border-bottom: 1.5px solid transparent;
  transition: border-color 0.2s;
}

nav a:hover,
nav a.active {
  border-bottom-color: var(--text);
}

/* Main content */
main {
  flex: 1;
  padding-bottom: 80px;
}

/* Homepage */
.intro h1 {
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.3;
  margin-bottom: 12px;
}

.intro .bio {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
  max-width: 440px;
  margin-bottom: 24px;
}

.social-links {
  display: flex;
  gap: 16px;
  margin-top: 8px;
}

.social-links a {
  color: var(--text-secondary);
  transition: color 0.2s;
}

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

.social-links svg {
  width: 18px;
  height: 18px;
}

hr {
  border: none;
  height: 1px;
  background: var(--accent);
  margin: 40px 0;
}

/* Post list */
.post-list {
  list-style: none;
}

.post-list li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 10px 0;
  gap: 16px;
}

.post-list li + li {
  border-top: 1px solid var(--accent);
}

.post-list a {
  font-size: 0.95rem;
  font-weight: 500;
  flex: 1;
}

.post-list .date {
  color: var(--text-secondary);
  font-size: 0.8rem;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* Article / Post page */
.post-header {
  margin-bottom: 32px;
}

.post-header h1 {
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.3;
  margin-bottom: 8px;
}

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

.post-content {
  font-size: 0.95rem;
  line-height: 1.7;
}

.post-content p {
  margin-bottom: 1.2em;
}

.post-content h2 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-top: 2em;
  margin-bottom: 0.8em;
  letter-spacing: -0.02em;
}

.post-content h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-top: 1.5em;
  margin-bottom: 0.6em;
}

.post-content ul,
.post-content ol {
  margin-bottom: 1.2em;
  padding-left: 1.5em;
}

.post-content li {
  margin-bottom: 0.4em;
}

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

.post-content a {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.post-content img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  margin: 1.5em 0;
}

.post-content code {
  font-family: 'SF Mono', 'Fira Code', 'Fira Mono', Menlo, Consolas, monospace;
  font-size: 0.85em;
  background: var(--code-bg);
  padding: 2px 6px;
  border-radius: 3px;
}

.post-content pre {
  background: var(--code-block-bg);
  border-radius: 6px;
  padding: 16px 20px;
  overflow-x: auto;
  margin: 1.5em 0;
  font-size: 0.85rem;
  line-height: 1.5;
}

.post-content pre code {
  background: none;
  padding: 0;
  border-radius: 0;
  color: #f8f8f2;
}

.post-content strong {
  font-weight: 600;
}

.post-content em {
  font-style: italic;
}

/* Back link */
.back-link {
  display: inline-block;
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 32px;
}

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

/* About page */
.about-content {
  font-size: 0.95rem;
  line-height: 1.7;
}

.about-content p {
  margin-bottom: 1.2em;
}

.about-content h2 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-top: 2em;
  margin-bottom: 0.8em;
}

.about-content ul {
  list-style: none;
  padding: 0;
}

.about-content ul li {
  padding: 4px 0;
}

/* Project list */
.project-list {
  list-style: none;
}

.project-list li {
  padding: 14px 0;
}

.project-list li + li {
  border-top: 1px solid var(--accent);
}

.project-list .project-header a {
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.project-list .project-desc {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-top: 4px;
  line-height: 1.5;
}

.project-list .project-desc code {
  font-family: 'SF Mono', 'Fira Code', 'Fira Mono', Menlo, Consolas, monospace;
  font-size: 0.85em;
  background: var(--code-bg);
  padding: 1px 5px;
  border-radius: 3px;
}

/* Experience / About */
.experience {
  margin-bottom: 1em;
}

.exp-item {
  padding: 12px 0;
}

.exp-item + .exp-item {
  border-top: 1px solid var(--accent);
}

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

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

.exp-role {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-top: 2px;
  font-style: italic;
}

.exp-item ul {
  list-style: disc;
  padding-left: 1.5em;
  margin-top: 8px;
}

.exp-item li {
  font-size: 0.88rem;
  padding: 3px 0;
  line-height: 1.5;
}

.exp-stack {
  color: var(--text-secondary);
  font-size: 0.78rem;
  margin-top: 8px;
  font-style: italic;
}

/* Footer */
footer {
  padding: 24px 0 48px;
  color: var(--text-secondary);
  font-size: 0.75rem;
}

/* Fade in animation */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

main {
  animation: fadeIn 0.4s ease-out;
}
