/* ── Reset & Base ── */

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  transition: background-color 0.3s, border-color 0.3s, color 0.3s;
}

:root {
  --text: #1a1a1a;
  --text-secondary: #555;
  --bg: #fff;
  --bg-secondary: #fafafa;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --border: #e5e5e5;
  --code-bg: #f5f5f5;
  --tag-bg: #f0f4ff;
  --max-width: 720px;
}

[data-theme="dark"] {
  --text: #e4e4e7;
  --text-secondary: #a1a1aa;
  --bg: #18181b;
  --bg-secondary: #27272a;
  --accent: #60a5fa;
  --accent-hover: #93bbfd;
  --border: #3f3f46;
  --code-bg: #27272a;
  --tag-bg: #1e293b;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  text-align: justify;
  -webkit-font-smoothing: antialiased;
  transition: background 0.3s, color 0.3s;
}

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

a:hover {
  text-decoration: underline;
}

/* ── Container ── */

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

/* ── Header & Navigation ── */

.site-header {
  border-bottom: 1px solid var(--border);
  padding: 1.25rem 0;
  transition: border-color 0.3s;
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.site-name {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
}

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

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

.nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.95rem;
  transition: color 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--accent);
}

/* ── Main Content ── */

main.container {
  padding-top: 2.5rem;
  padding-bottom: 4rem;
  min-height: calc(100vh - 160px);
}

/* ── Home Page ── */

.home-intro {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  margin-bottom: 2rem;
}

.home-photo {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.home-text h1 {
  font-size: 1.6rem;
  margin-bottom: 0.25rem;
  font-weight: 700;
}

.home-text .subtitle {
  color: var(--text-secondary);
  font-size: 1rem;
  margin-bottom: 1rem;
}

.home-links {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.home-links a {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.9rem;
}

.home-links a:hover {
  text-decoration: underline;
}

/* ── Page Content (CV, Writing) ── */

.page-content h1 {
  font-size: 1.6rem;
  margin-bottom: 1.5rem;
  font-weight: 700;
}

.page-content h2 {
  font-size: 1.2rem;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  font-weight: 600;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.35rem;
}

.page-content h3 {
  font-size: 1.05rem;
  margin-top: 1.25rem;
  margin-bottom: 0.4rem;
  font-weight: 600;
}

.page-content p {
  margin-bottom: 1rem;
}

.page-content ul {
  margin-left: 1.25rem;
  margin-bottom: 1rem;
}

.page-content li {
  margin-bottom: 0.35rem;
}

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

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

/* ── CV-specific ── */

.cv-entry {
  margin-bottom: 1.75rem;
  padding-left: 1.25rem;
  border-left: 2px solid var(--border);
  position: relative;
}

.cv-entry::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 6px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

.cv-entry-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.cv-entry-header h3 {
  margin: 0;
  font-size: 1.05rem;
}

.cv-date {
  color: var(--text-secondary);
  font-size: 0.82rem;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.cv-role {
  color: var(--text);
  font-size: 0.95rem;
  margin-bottom: 0.15rem;
  font-weight: 500;
}

.cv-location {
  color: var(--text-secondary);
  font-size: 0.82rem;
  margin-bottom: 0.5rem;
}

.cv-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.6rem;
}

.cv-tech .tag {
  display: inline-block;
  background: var(--tag-bg);
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 500;
  padding: 0.15em 0.55em;
  border-radius: 999px;
  letter-spacing: 0.01em;
}

.cv-entry ul {
  margin-top: 0.4rem;
  margin-left: 1rem;
  margin-bottom: 0;
}

.cv-entry li {
  font-size: 0.92rem;
  line-height: 1.6;
  margin-bottom: 0.3rem;
  color: var(--text);
}

/* ── CV Publications ── */

.cv-pub {
  padding: 0.85rem 1rem;
  background: var(--bg-secondary);
  border-radius: 6px;
  margin-bottom: 0.6rem;
  border: 1px solid var(--border);
}

.cv-pub .pub-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
}

.cv-pub .pub-link {
  font-size: 0.85rem;
  margin-left: 0.25rem;
}

/* ── CV Skills ── */

.cv-skills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.5rem;
}

.cv-skills .tag {
  display: inline-block;
  background: var(--bg-secondary);
  color: var(--text);
  font-size: 0.8rem;
  padding: 0.25em 0.7em;
  border-radius: 999px;
  border: 1px solid var(--border);
}

/* ── CV Download Button ── */

.cv-download {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 1rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 6px;
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
  margin-bottom: 0.5rem;
}

.cv-download:hover {
  background: var(--accent);
  color: var(--bg);
  text-decoration: none;
}

/* ── Writing / Blog ── */

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

.post-list li {
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}

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

.post-list a {
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  font-size: 1.05rem;
}

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

.post-date {
  display: block;
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-top: 0.2rem;
}

/* ── Plate (Restaurant Reviews) ── */

.plate-list {
  margin-top: 0.5rem;
}

.plate-item {
  display: flex;
  gap: 0.6rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
  align-items: stretch;
}

.plate-item:last-child {
  border-bottom: none;
}

.plate-rank {
  color: var(--text-secondary);
  font-size: 0.9rem;
  min-width: 1.4rem;
  flex-shrink: 0;
}

.plate-text {
  flex: 1;
  min-width: 0;
  font-size: 0.9rem;
  line-height: 1.55;
}

.plate-score {
  color: var(--text-secondary);
}

.plate-meta {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.plate-desc {
  color: var(--text);
}

.plate-photo {
  flex-shrink: 0;
  align-self: stretch;
  width: auto;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 4px;
}

/* ── Footer ── */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 0;
  text-align: center;
  transition: border-color 0.3s;
}

.site-footer p {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

/* ── Prose (blog posts) ── */

.page-content blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 1rem;
  margin: 1.5rem 0;
  color: var(--text-secondary);
  font-style: italic;
}

.page-content code {
  background: var(--code-bg);
  padding: 0.15em 0.4em;
  border-radius: 3px;
  font-size: 0.9em;
}

.page-content pre {
  background: var(--code-bg);
  padding: 1rem;
  border-radius: 6px;
  overflow-x: auto;
  margin-bottom: 1rem;
}

.page-content pre code {
  background: none;
  padding: 0;
}

.page-content img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
}

.page-content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2rem 0;
}

/* ── Theme Toggle ── */

.theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
  color: var(--text-secondary);
  font-size: 1.1rem;
  line-height: 1;
  transition: color 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.4rem;
}

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

.theme-toggle .icon-sun,
.theme-toggle .icon-moon {
  transition: opacity 0.3s, transform 0.3s;
}

[data-theme="dark"] .theme-toggle .icon-sun { display: inline; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: inline; }

/* ── Responsive ── */

@media (max-width: 600px) {
  .home-intro {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .home-links {
    justify-content: center;
  }

  .nav-container {
    flex-direction: column;
    gap: 0.75rem;
  }

  .cv-entry-header {
    flex-direction: column;
  }

  .cv-entry {
    padding-left: 1rem;
  }
}

