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

html {
  font-size: 18px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  color: #1a1a1a;
  background: #fff;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ---- Homepage ---- */
.home {
  background: #000;
  overflow: hidden;
}

.home-bg {
  position: fixed;
  z-index: 0;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-position: center center;
  background-repeat: no-repeat;
  background-size: cover;
  opacity: 0.85;
}

/* ---- Site Header ---- */
.site-header {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  max-width: 680px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 0;
}

.home .site-header {
  max-width: none;
  padding: 2rem 2.5rem 0;
}

.home .site-header .site-title {
  /* color: #fff; */
  /* text-shadow: 0 1px 6px rgba(0,0,0,0.5); */
}

.home .site-header nav a {
  /* color: #fff; */
  /* text-shadow: 0 1px 6px rgba(0,0,0,0.5); */
}

.home .site-header nav a:hover {
  /* opacity: 0.7; */
}

.site-header .site-title {
  font-size: 0.9rem;
  font-weight: 400;
  color: #1a1a1a;
  text-decoration: none;
  letter-spacing: 0.06em;
}

.site-header nav {
  display: flex;
  gap: 2rem;
}

.site-header nav a {
  font-size: 0.9rem;
  color: #555;
  text-decoration: none;
  letter-spacing: 0.04em;
}

.site-header nav a:hover {
  color: #1a1a1a;
}

/* ---- Page Content (Writing index) ---- */
.page-content {
  max-width: 680px;
  margin: 0 auto;
  padding: 3rem 1.5rem 4rem;
}

.post-list {
  list-style: none;
  margin-top: 1rem;
}

.post-list li {
  display: flex;
  align-items: baseline;
  gap: 1.2rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid #eee;
}

.post-list li:last-child {
  border-bottom: none;
}

.post-list time {
  font-size: 0.78rem;
  color: #999;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.post-list a {
  font-size: 1rem;
  color: #1a1a1a;
  text-decoration: none;
}

.post-list a:hover {
  text-decoration: underline;
}

/* ---- Post ---- */
.post {
  max-width: 680px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 5rem;
}

.post-header {
  margin-bottom: 2.5rem;
}

.post-header h1 {
  font-size: 1.8rem;
  font-weight: 600;
  line-height: 1.3;
  color: #1a1a1a;
  margin-bottom: 0.4rem;
}

.post-header time {
  font-size: 0.82rem;
  color: #999;
}

/* ---- Project Archived Banner ---- */
.project-archived {
  font-size: 0.85rem;
  color: #db5405;
  background: #ffe2d1;
  border-left: 3px solid #db5405;
  padding: 0.6rem 1rem;
  margin-bottom: 2rem;
}

/* ---- Post Content Typography ---- */
.post-content h2 {
  font-size: 1.3rem;
  font-weight: 600;
  margin-top: 2.4rem;
  margin-bottom: 0.8rem;
  color: #1a1a1a;
}

.post-content h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-top: 2rem;
  margin-bottom: 0.6rem;
  color: #1a1a1a;
}

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

.post-content a {
  color: #1a1a1a;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.post-content a:hover {
  color: #555;
}

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

.post-content li {
  margin-bottom: 0.3rem;
}

.post-content li > ul,
.post-content li > ol {
  margin-bottom: 0;
  margin-top: 0.3rem;
}

.post-content blockquote {
  border-left: 3px solid #ddd;
  padding-left: 1rem;
  color: #555;
  margin: 1.4rem 0;
}

.post-content hr {
  border: none;
  border-top: 1px solid #eee;
  margin: 2rem 0;
}

.post-content code {
  font-family: "SF Mono", "Fira Code", "Fira Mono", Menlo, Consolas, monospace;
  font-size: 0.85em;
  background: #f5f5f5;
  padding: 0.15em 0.4em;
  border-radius: 3px;
}

.post-content pre {
  background: #f5f5f5;
  padding: 1.2rem;
  border-radius: 4px;
  overflow-x: auto;
  margin-bottom: 1.4rem;
  line-height: 1.5;
}

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

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

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

/* ---- Responsive ---- */
@media (max-width: 600px) {
  html {
    font-size: 16px;
  }

  .site-header {
    padding: 1.5rem 1rem 0;
  }

  .post,
  .page-content {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .post-header h1 {
    font-size: 1.5rem;
  }

  .post-list li {
    flex-direction: column;
    gap: 0.2rem;
  }
}
