:root {
  --bg: #f2fcff;
  --surface: #ffffff;
  --border: rgba(0, 0, 0, 0.1);
  --border-hover: #B1CAD7;

  --text: #121212;
  --text-muted: #4a5568;
  --accent: #B1CAD7;
  --link: #2b6cb0;

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  --container: 720px;
}

html {
  scrollbar-gutter: stable;
}

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

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

/* Header */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2.5rem 1.5rem 1.5rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  font-size: 2rem;
}

.color-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background-color: var(--accent);
}

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

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.15s ease;
}

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

/* Sections */
.section {
  padding: 2.5rem 0;
}

h1 {
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin-bottom: 1rem;
}

/* Rotating Multilingual Greeting */
.greeting-text {
  display: inline-block;
  transition: opacity 0.35s ease, transform 0.35s ease;
  will-change: opacity, transform;
}

.greeting-text.fade-out {
  opacity: 0;
  transform: translateY(-6px);
}

h2 {
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 1.25rem;
  color: var(--text);
}

.lead {
  font-size: 1.15rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* Grid & Cards */
.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

@media (min-width: 600px) {
  .grid {
    grid-template-columns: 1fr 1fr;
  }
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.5rem;
  transition: border-color 0.2s ease, transform 0.2s ease;
  display: flex;
  flex-direction: column;
  text-decoration: none !important;
  color: inherit;
}

.card:hover,
.card:focus,
.card:active,
.card:visited {
  text-decoration: none !important;
}

.card * {
  text-decoration: none !important;
}

.card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
}

.card h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text);
}

.badge {
  font-size: 0.72rem;
  font-family: var(--font-mono);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.06);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.card p {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.5;
  margin-bottom: 1rem;
}

.card .card-action {
  margin-top: auto;
}

.link {
  color: var(--link);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
}

.card:hover .link {
  text-decoration: none;
}

/* Posts / Writing List */
.posts-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.post-item {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.post-meta {
  display: flex;
  align-items: baseline;
  gap: 1rem;
}

.post-date {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-muted);
  min-width: 80px;
}

.post-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  transition: color 0.15s ease;
}

.post-title:hover {
  color: var(--link);
  text-decoration: underline;
}

.post-desc {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.5;
  padding-left: calc(80px + 1rem);
}

@media (max-width: 600px) {
  .post-meta {
    flex-direction: column;
    gap: 0.25rem;
  }

  .post-desc {
    padding-left: 0;
  }
}

/* Article Reader Typography */
.article-body {
  padding-bottom: 4rem;
  color: var(--text);
  line-height: 1.75;
}

.article-body h1 {
  font-size: 2.2rem;
  margin-bottom: 1.5rem;
  letter-spacing: -0.03em;
}

.article-body h2 {
  font-size: 1.4rem;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
}

.article-body h3 {
  font-size: 1.15rem;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

.article-body p {
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  font-size: 1rem;
}

.article-body hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 2.5rem 0;
}

.article-body ul, .article-body ol {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  padding-left: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.article-body code {
  font-family: var(--font-mono);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-size: 0.88rem;
  color: var(--text);
}

.article-body pre {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem;
  overflow-x: auto;
  margin-bottom: 1.5rem;
}

.article-body pre code {
  background: transparent;
  border: 0;
  padding: 0;
  font-size: 0.88rem;
}

.article-body blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 1.25rem;
  margin: 1.5rem 0;
  color: var(--text-muted);
  font-style: italic;
}

.article-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.92rem;
}

.article-body th, .article-body td {
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  text-align: left;
}

.article-body th {
  background: var(--surface);
  color: var(--text);
}

/* Footer */
.footer {
  margin-top: auto;
  padding: 2.5rem 1.5rem;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.88rem;

  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2.5rem;
}

.footer .nav-links {
  gap: 2rem;
  flex-wrap: wrap;
}