:root[data-theme="light"] {
  --bg: #f0ede5;
  --text: #222222;
  --dim: #777777;
  --border: #e0e0e0;
  --border-strong: #cccccc;
  --border-subtle: #eeeeee;
  --accent: #4070b8;
  --bg-code: #f5f5f5;
}

:root[data-theme="dark"] {
  --bg: #1f1e24;
  --text: #d4d4d4;
  --dim: #888888;
  --border: #333333;
  --border-strong: #555555;
  --border-subtle: #2a2a2a;
  --accent: #6fa8e0;
  --bg-code: #222222;
}

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

body {
  font-family: 'DM Sans', 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 17px;
  line-height: 1.7;
  transition: background 0.2s, color 0.2s;
}

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

a:hover {
  text-decoration: underline;
}

/* --- Layout --- */
.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 20px;
}

/* --- Header --- */
header {
  padding: 20px 0 16px;
  margin-bottom: 28px;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.site-title {
  font-family: 'DM Sans', 'Helvetica Neue', Arial, sans-serif;
  font-size: 16px;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
}

.site-title:hover {
  text-decoration: none;
  color: var(--accent);
}

nav {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

nav a {
  font-family: 'DM Sans', 'Helvetica Neue', Arial, sans-serif;
  font-size: 14px;
  color: var(--dim);
  padding: 2px 0;
}

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

nav .sep {
  color: var(--border);
  font-size: 12px;
  user-select: none;
}

.theme-toggle {
  background: none;
  border: none;
  font-family: 'DM Sans', 'Helvetica Neue', Arial, sans-serif;
  font-size: 14px;
  color: var(--dim);
  cursor: pointer;
  padding: 2px 0;
}

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

/* --- Page Title --- */
.page-title {
  font-size: 26px;
  font-weight: 600;
  margin-bottom: 8px;
}

.page-desc {
  color: var(--dim);
  font-size: 16px;
  margin-bottom: 28px;
}

/* --- Section Headings --- */
.section-heading {
  font-family: 'DM Sans', 'Helvetica Neue', Arial, sans-serif;
  font-size: 13px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text);
  margin-top: 32px;
  margin-bottom: 10px;
}

/* --- Intro --- */
.intro {
  margin-bottom: 28px;
}

.intro::after {
  content: "";
  display: table;
  clear: both;
}

.intro p {
  margin-bottom: 12px;
  line-height: 1.65;
}

.intro .pron {
  color: var(--dim);
  font-style: italic;
}

/* --- Links List --- */
.link-list {
  list-style: none;
  margin-bottom: 12px;
}

.link-list li {
  padding: 1px 0;
  line-height: 1.6;
}

.link-list li::before {
  content: "– ";
  color: var(--dim);
}

/* --- Posts --- */
.posts {
  margin-top: 8px;
  margin-bottom: 16px;
}

.post-item {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 3px 0;
}

.post-date {
  font-family: 'DM Sans', 'Helvetica Neue', Arial, sans-serif;
  font-size: 13px;
  color: var(--dim);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
  min-width: 38px;
}

.post-link {
  font-size: 16px;
}

/* --- Post Full --- */
.post-full {
  margin-bottom: 32px;
  padding-bottom: 28px;
}

.post-full-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 4px;
}

.post-full-title a {
  color: var(--text);
}

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

.post-full-date {
  font-size: 13px;
  color: var(--dim);
  margin-bottom: 12px;
}

.post-full-excerpt {
  font-size: 15px;
  color: var(--dim);
  line-height: 1.65;
}

/* --- Project Card --- */
.project-entry {
  margin-bottom: 28px;
  padding-bottom: 24px;
}

.project-entry-title {
  font-size: 19px;
  font-weight: 600;
  margin-bottom: 4px;
}

.project-entry-title a {
  color: var(--text);
}

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

.project-entry-desc {
  font-size: 15px;
  line-height: 1.65;
  margin-bottom: 8px;
}

.project-entry-tags {
  font-family: 'DM Sans', 'Helvetica Neue', Arial, sans-serif;
  font-size: 12px;
  letter-spacing: 0.03em;
  color: var(--dim);
}

/* --- Divider --- */
hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 28px 0;
}

/* --- Footer --- */
footer {
  margin-top: 32px;
  padding: 20px 0 40px;
  font-size: 14px;
  color: var(--dim);
}

.footer-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 0;
  margin-bottom: 6px;
}

.footer-row a {
  color: var(--dim);
  font-size: 13.5px;
}

.footer-row a:hover {
  color: var(--text);
}

.footer-row .sep {
  color: var(--border);
  font-size: 12px;
  margin: 0 6px;
  user-select: none;
}

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

  .container {
    padding: 0 16px;
  }

  .header-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  nav {
    gap: 4px 6px;
  }

  nav .sep {
    font-size: 10px;
  }

  .intro p {
    line-height: 1.6;
  }

  .page-title {
    font-size: 22px;
  }

  .section-heading {
    margin-top: 24px;
  }

  .post-item {
    gap: 8px;
  }

  .post-date {
    min-width: 34px;
    font-size: 12px;
  }

  .post-link {
    font-size: 15px;
  }

  .project-entry-title {
    font-size: 17px;
  }

  .project-entry-desc {
    font-size: 14px;
  }

  .footer-row {
    gap: 4px 0;
  }

  .footer-row a {
    font-size: 13px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
