:root {
  --bg: #ffffff;
  --text: #1c1c1c;
  --muted: #5b5b5b;
  --accent: #2698ba;
  --rule: #e4e4e4;
  --btn-bg: #1c1c1c;
  --btn-text: #ffffff;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1c1c1d;
    --text: #e8e8e8;
    --muted: #a3a3a3;
    --accent: #4fb8d8;
    --rule: #333333;
    --btn-bg: #e8e8e8;
    --btn-text: #1c1c1d;
  }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
}

body {
  font-family: "Roboto", "Helvetica Neue", Arial, sans-serif;
  font-weight: 300;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

main {
  max-width: 900px;
  margin: 0 auto;
  padding: 6vh 24px 10vh;
}

.intro {
  display: flex;
  gap: 48px;
  align-items: flex-start;
  justify-content: space-between;
}

.intro-text {
  flex: 1;
  min-width: 0;
}

h1 {
  font-size: 2.6rem;
  font-weight: 300;
  margin: 0 0 0.3em;
  letter-spacing: -0.01em;
}

h1 strong {
  font-weight: 600;
}

.tagline {
  font-style: italic;
  color: var(--muted);
  font-size: 1.05rem;
  margin: 0 0 1.6em;
}

p {
  margin: 0 0 1.1em;
  font-size: 1rem;
}

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

.photo {
  flex: 0 0 220px;
  width: 220px;
  height: 220px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--rule);
}
.photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.cv-button {
  display: inline-block;
  margin-top: 0.6em;
  padding: 0.6em 1.3em;
  background: var(--btn-bg);
  color: var(--btn-text);
  border-radius: 6px;
  font-weight: 400;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
}
.cv-button:hover {
  text-decoration: none;
  opacity: 0.85;
}

.links {
  margin-top: 1.6em;
  font-size: 0.95rem;
}
.links a {
  margin-right: 1.2em;
}

.work {
  margin-top: 4em;
  padding-top: 2.4em;
  border-top: 1px solid var(--rule);
}
.work h2 {
  font-size: 1.5rem;
  font-weight: 400;
  margin: 0 0 1.2em;
  letter-spacing: -0.01em;
}
.work-item h3 {
  font-size: 1.1rem;
  font-weight: 400;
  margin: 0 0 0.3em;
  line-height: 1.4;
}
.work-item h3 a { color: var(--text); }
.work-item h3 a:hover { color: var(--accent); text-decoration: none; }
.work-meta {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0 0 0.8em;
}

footer {
  max-width: 900px;
  margin: 0 auto;
  padding: 2em 24px 3em;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.85rem;
}

@media (max-width: 640px) {
  .intro {
    flex-direction: column-reverse;
    align-items: center;
    text-align: center;
    gap: 24px;
  }
  .intro-text { text-align: left; }
  .photo { flex: 0 0 auto; }
}

/* ---------- Blog ---------- */

.back-link {
  display: inline-block;
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 2.4em;
}
.back-link:hover { color: var(--accent); }

.page-title {
  font-size: 2.2rem;
  font-weight: 300;
  margin: 0 0 0.3em;
  letter-spacing: -0.01em;
}

.page-intro {
  color: var(--muted);
  margin: 0 0 3em;
  max-width: 60ch;
}

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

.post {
  padding: 2em 0;
  border-top: 1px solid var(--rule);
}
.post:last-child { border-bottom: 1px solid var(--rule); }

.post-date {
  display: block;
  font-size: 0.82rem;
  color: var(--muted);
  letter-spacing: 0.02em;
  margin-bottom: 0.5em;
}

.post-title {
  font-size: 1.35rem;
  font-weight: 400;
  margin: 0 0 0.45em;
  line-height: 1.35;
}
.post-title a { color: var(--text); }
.post-title a:hover {
  color: var(--accent);
  text-decoration: none;
}

.post-excerpt {
  margin: 0;
  color: var(--muted);
  font-size: 0.97rem;
  max-width: 68ch;
}

.empty-state {
  padding: 2.5em 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  color: var(--muted);
}
.empty-state p { margin: 0; }

.subscribe {
  margin-top: 3em;
}

/* ---------- Projects ---------- */

.project-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 24px;
}

.project-card {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  padding: 20px;
  border: 1px solid var(--rule);
  border-radius: 10px;
  color: var(--text);
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.project-card:hover {
  text-decoration: none;
  border-color: var(--accent);
  transform: translateY(-2px);
}

.project-thumb {
  flex: 0 0 260px;
  aspect-ratio: 8 / 5;
  border-radius: 6px;
  overflow: hidden;
  background: var(--rule);
}
.project-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.project-body {
  flex: 1;
  min-width: 0;
}

.project-title {
  font-size: 1.35rem;
  font-weight: 400;
  margin: 0 0 0.45em;
  line-height: 1.35;
}
.project-card:hover .project-title { color: var(--accent); }

.project-desc {
  margin: 0;
  color: var(--muted);
  font-size: 0.97rem;
}

@media (max-width: 640px) {
  .project-card { flex-direction: column; gap: 16px; }
  .project-thumb { flex: 0 0 auto; width: 100%; }
}
