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

:root {
  --body-bg: #ffffff;
  --primary-font-color: #111;
  --muted-color: #666;
  --accent: #2563eb;
  --transition: 0.15s ease;
}

[data-theme="dark"] {
  --body-bg: #0f0f0f;
  --primary-font-color: #e5e5e5;
  --muted-color: #a3a3a3;
  --accent: #60a5fa;
}

* {
  box-sizing: border-box;
}

body {
  font-family: 'IBM Plex Sans', sans-serif;
  font-weight: 400;
  background: var(--body-bg);
  color: var(--primary-font-color);
  margin: 0;
  padding: 0;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.3;
  color: var(--primary-font-color);
}

h1 { font-size: 1.875rem; margin-top: 0; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }

.container {
  display: flex;
  flex-direction: column;
  width: 92%;
  max-width: 640px;
  margin: 0 auto;
  padding: 3rem 1rem 4rem;
}

/* ----- Profile: no box, just layout ----- */
.profile {
  width: 100%;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 3rem;
  padding: 0;
}

.profile-image-container {
  width: auto;
}

.profile-image {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  transition: opacity var(--transition);
}

.profile-image:hover {
  opacity: 0.9;
}

.profile-about {
  flex: 1;
  min-width: 200px;
  text-align: right;
}

.profile-about h2 {
  margin: 0 0 0.35rem 0;
  font-size: 1.35rem;
  font-weight: 600;
}

.profile-about .social-icon {
  height: 20px;
  width: 20px;
  opacity: 0.7;
  transition: opacity var(--transition);
  vertical-align: middle;
  margin-left: 8px;
}

.profile-about .social-icon:hover {
  opacity: 1;
}

.mode {
  display: inline-block;
  vertical-align: middle;
  margin-left: 10px;
  float: none;
}

.profile-bio {
  margin: 0.4rem 0 0.6rem 0;
  color: var(--muted-color);
  font-size: 0.9375rem;
  line-height: 1.5;
}

.profile-about .nav-row {
  margin-top: 0.5rem;
}

/* ----- Post list: plain list, no boxes ----- */
.post-container {
  display: flex;
  flex-direction: column;
  width: 100%;
  gap: 0;
}

.post-list {
  width: 100%;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid transparent;
  border-color: var(--body-bg);
  text-decoration: none;
  color: inherit;
  transition: color var(--transition);
}

[data-theme="light"] .post-list {
  border-color: rgba(0, 0, 0, 0.06);
}

[data-theme="dark"] .post-list {
  border-color: rgba(255, 255, 255, 0.06);
}

.post-list:hover .post-title {
  color: var(--accent);
}

.post-list .post-title {
  flex: 1;
  min-width: 0;
  font-weight: 500;
  font-size: 1rem;
  color: var(--primary-font-color);
  margin: 0;
  transition: color var(--transition);
}

.post-list .post-date {
  flex-shrink: 0;
  font-size: 0.8125rem;
  color: var(--muted-color);
  font-weight: 400;
}

/* ----- Post header: one line, no box ----- */
.post-header {
  width: 100%;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 0 0 1.25rem 0;
  margin-bottom: 0.5rem;
  background: none;
  border: none;
}

.post-header .post-date {
  font-weight: 400;
  color: var(--muted-color);
  font-size: 0.875rem;
}

.post-header .post-share {
  font-weight: 400;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
}

.post-share-label {
  color: var(--muted-color);
  font-size: 0.8125rem;
}

.post-header .post-share a {
  display: inline-flex;
  padding: 2px;
  opacity: 0.7;
  transition: opacity var(--transition);
}

.post-header .post-share a:hover {
  opacity: 1;
}

/* ----- Blog post content ----- */
.blog-post-content {
  width: 100%;
  font-size: 1rem;
  line-height: 1.7;
}

.blog-post-content h1 {
  margin-bottom: 0.5em;
}

.blog-post-content p {
  margin: 0 0 1em 0;
}

.blog-post-content a {
  color: var(--accent);
  text-decoration: none;
}

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

/* ----- Tags: minimal pills ----- */
.tags-container {
  width: 100%;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1.25rem;
  margin-bottom: 1.25rem;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag {
  color: var(--muted-color);
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  font-size: 0.8125rem;
  font-weight: 500;
  background: none;
  border: none;
  transition: color var(--transition);
}

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

.post-tag {
  margin-bottom: 0;
}

/* ----- Navigation (prev/next): text only ----- */
.navigation {
  width: 100%;
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-top: 2.5rem;
  margin-bottom: 0;
  padding: 1.25rem 0 0;
  background: none;
  border: none;
  border-top: 1px solid transparent;
}

[data-theme="light"] .navigation {
  border-color: rgba(0, 0, 0, 0.06);
}

[data-theme="dark"] .navigation {
  border-color: rgba(255, 255, 255, 0.06);
}

.navigation .prev,
.navigation .next {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: var(--primary-font-color);
  font-weight: 400;
  font-size: 0.9375rem;
  padding: 0.25rem 0;
}

.navigation .prev { text-align: left; }
.navigation .next { text-align: right; }

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

/* ----- Pagination: text only ----- */
.pagination {
  width: 100%;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 0 0;
  margin-top: 2rem;
  margin-bottom: 0;
  background: none;
  border: none;
}

.pagination .prev,
.pagination .next {
  color: var(--primary-font-color);
  font-weight: 400;
  font-size: 0.9375rem;
}

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

/* ----- Footer ----- */
.footer {
  display: flex;
  justify-content: center;
  width: 100%;
  padding: 2.5rem 0 0;
  margin-top: 0.5rem;
  font-size: 0.8125rem;
  color: var(--muted-color);
}

/* ----- Nav row (home / projects) ----- */
.nav-row {
  display: flex;
  gap: 1.25rem;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.nav-row a {
  font-size: 0.9375rem;
  font-weight: 400;
  color: var(--muted-color);
  text-decoration: none;
  transition: color var(--transition);
}

.nav-row a:hover {
  color: var(--accent);
}

/* ----- Global links ----- */
a {
  color: var(--primary-font-color);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  text-decoration: none;
}

/* ----- Images & code ----- */
img {
  max-width: 100%;
  height: auto;
}

figure {
  margin: 1.5em 0;
  padding: 0;
}

pre {
  font-size: 0.875rem;
  max-width: 100%;
  overflow: auto;
  padding: 1rem 1.25rem;
  border-radius: 6px;
  background: var(--body-bg);
}

[data-theme="light"] pre {
  background: #f4f4f5;
  color: #18181b;
}

[data-theme="dark"] pre {
  background: #1c1c1e;
  color: #e5e5e5;
}

/* ----- Theme toggle ----- */
[data-theme="dark"] .social-icon {
  filter: invert(100%) sepia(50%) saturate(0%) hue-rotate(360deg) brightness(100%) contrast(100%);
}

.mode {
  float: right;
  position: relative;
  margin: auto;
  width: 42px;
  height: 22px;
  background: #F1F2F4;
  border-radius: 20px;
  cursor: pointer;
}

.mode:after {
  content: "☀️";
  position: absolute;
  top: 0;
  left: 4px;
  font-size: 14px;
  height: 22px;
  line-height: 23px;
  text-align: center;
  transition: all 0.3s ease;
}

.mode.active {
  background: #0771ca;
}

.mode.active:after {
  content: "🌛";
  transform: translateX(20px);
}

.mode.active span {
  transform: translateX(0);
}

.mode span {
  position: absolute;
  z-index: 1;
  margin: 2px;
  display: block;
  width: 18px;
  height: 18px;
  background: white;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  transform: translateX(20px);
  transition: all 0.4s ease;
}

/* ----- Projects page ----- */
.projects-page {
  width: 100%;
  margin-top: 0.5rem;
}

.project-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.project-item {
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
  padding: 2rem 0;
  border-bottom: 1px solid transparent;
}

[data-theme="light"] .project-item {
  border-color: rgba(0, 0, 0, 0.06);
}

[data-theme="dark"] .project-item {
  border-color: rgba(255, 255, 255, 0.06);
}

.project-item:first-child {
  padding-top: 0;
}

.project-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.project-image-link {
  flex-shrink: 0;
  display: block;
  line-height: 0;
  border-radius: 8px;
  overflow: hidden;
  transition: opacity var(--transition);
}

.project-image-link:hover {
  opacity: 0.9;
}

.project-image {
  width: 200px;
  height: 140px;
  object-fit: cover;
  display: block;
}

.project-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.project-title {
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--primary-font-color);
  margin: 0 0 0.15em 0;
}

.project-desc {
  color: var(--muted-color);
  font-size: 0.9375rem;
  line-height: 1.5;
  margin: 0;
}

.project-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.25rem;
}

.project-meta a {
  display: inline-flex;
  padding: 4px;
  color: var(--muted-color);
  transition: color var(--transition);
}

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

.project-meta .social-icon {
  height: 20px;
  width: 20px;
}

.project-meta .external-link {
  height: 18px;
  width: 18px;
}

.project-langs {
  font-size: 0.8125rem;
  color: var(--muted-color);
}

/* ----- Responsive ----- */
@media (min-width: 1200px) {
  .container {
    max-width: 680px;
  }
}

@media only screen and (max-width: 768px) {
  .container {
    width: 100%;
    padding: 2rem 1rem 3rem;
  }

  .profile {
    flex-direction: column;
    text-align: center;
    margin-bottom: 2.5rem;
  }

  .profile-about {
    text-align: center;
  }

  .profile-about .social-icon {
    margin-left: 6px;
    margin-right: 6px;
  }

  .mode {
    margin: 0.25rem 0 0 0;
  }

  .nav-row {
    justify-content: center;
  }

  h1 {
    font-size: 1.5rem;
  }

  .profile-image {
    width: 72px;
    height: 72px;
  }

  .post-list {
    padding: 0.65rem 0;
  }

  .post-list .post-title {
    font-size: 0.9375rem;
  }

  .post-list .post-date {
    font-size: 0.75rem;
  }

  .project-item {
    flex-direction: column;
    gap: 1rem;
    padding: 1.5rem 0;
  }

  .project-image-link {
    width: 100%;
    max-width: 320px;
  }

  .project-image {
    width: 100%;
    height: auto;
    aspect-ratio: 16/10;
  }

  .project-title {
    font-size: 1rem;
  }

  .project-langs {
    display: none;
  }
}
