/* --- Variables (default = system / light) --- */
:root {
  --bg: #fafaf9;
  --bg-muted: #f0eeeb;
  --text: #1c1917;
  --text-muted: #57534e;
  --accent: #2980b9;
  --accent-hover: #1a5276;
  --border: #e7e5e4;
  --font-serif: "Cormorant Garamond", Georgia, serif;
  --font-sans: "Source Sans 3", system-ui, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg: #1c1917;
    --bg-muted: #292524;
    --text: #fafaf9;
    --text-muted: #a8a29e;
    --accent: #7dd3fc;
    --accent-hover: #bae6fd;
    --border: #44403c;
  }
}

[data-theme="dark"] {
  --bg: #1c1917;
  --bg-muted: #292524;
  --text: #fafaf9;
  --text-muted: #a8a29e;
  --accent: #7dd3fc;
  --accent-hover: #bae6fd;
  --border: #44403c;
}

[data-theme="light"] {
  --bg: #fafaf9;
  --bg-muted: #f0eeeb;
  --text: #1c1917;
  --text-muted: #57534e;
  --accent: #2980b9;
  --accent-hover: #1a5276;
  --border: #e7e5e4;
}

/* --- Base --- */
*, *::before, *::after { box-sizing: border-box; }
html { font-size: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-weight: 400;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
}

.hidden { display: none !important; }

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover { text-decoration: underline; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* --- Header --- */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.logo {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 1.25rem;
  color: var(--text);
  letter-spacing: 0.02em;
}
.logo:hover { text-decoration: none; color: var(--accent); }
.nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}
.nav-link {
  font-size: 0.9375rem;
  color: var(--text-muted);
}
.nav-link:hover { color: var(--text); text-decoration: none; }
.nav-link.active { color: var(--text); font-weight: 500; }
.header-toggles {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.toggle {
  background: none;
  border: none;
  font-family: inherit;
  font-size: 0.8125rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.25rem 0;
}
.toggle:hover { color: var(--text); }
.toggle .lang-option,
.toggle .theme-option { cursor: pointer; }
.toggle .lang-option.active,
.toggle .theme-option.active { color: var(--text); font-weight: 500; }
.toggle .lang-sep,
.toggle .theme-sep { margin: 0 0.2rem; opacity: 0.6; }
.toggle-theme {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.toggle-theme .theme-option {
  display: inline-flex;
  opacity: 0.45;
}
.toggle-theme .theme-option:hover { opacity: 0.75; }
.toggle-theme .theme-option.active { opacity: 1; }
.toggle-theme .theme-icon {
  display: block;
  color: currentColor;
}

/* --- Page --- */
.page {
  max-width: 42rem;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}
.page-contact {
  padding-top: 3rem;
}

/* --- CV --- */
.cv-header {
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
  margin-bottom: 2rem;
}
.cv-photo {
  flex-shrink: 0;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
}
.cv-header-text { min-width: 0; }
.cv-name {
  font-family: var(--font-serif);
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 600;
  margin: 0 0 0.5rem;
  color: var(--text);
  line-height: 1.2;
}
.cv-meta {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--text-muted);
}
.cv-meta .meta-item + .meta-item::before {
  content: " · ";
}
.cv-meta a { color: var(--text-muted); }
.cv-meta a:hover { color: var(--accent); }

.cv-section {
  margin-bottom: 2rem;
}
.section-title {
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text);
  margin: 0 0 0.75rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--border);
}
.cv-item {
  margin-bottom: 1.25rem;
}
.cv-item-compact { margin-bottom: 1rem; }
.cv-item-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.25rem;
}
.cv-item-role {
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
  color: var(--text);
}
.cv-item-org {
  font-size: 0.9375rem;
  color: var(--accent);
  white-space: nowrap;
}
.cv-item-org:hover { text-decoration: underline; }
.cv-item-meta {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin: 0.15rem 0 0;
}
.cv-item-org-full { font-style: italic; }
.cv-item-desc,
.cv-item-note {
  font-size: 0.9375rem;
  color: var(--text-muted);
  margin: 0.35rem 0 0;
  max-width: 36rem;
}
.cv-item-links {
  margin: 0.5rem 0 0;
  padding-left: 1.25rem;
  font-size: 0.9375rem;
  color: var(--text-muted);
}
.cv-item-links li { margin-bottom: 0.35rem; }
.cv-item-links a { color: var(--accent); }
.cv-item-links small { opacity: 0.9; }
.cv-early {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin: 0.5rem 0 0;
}

.skills-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem 2rem;
  margin-bottom: 1rem;
}
@media (max-width: 480px) {
  .skills-grid { grid-template-columns: 1fr; }
}
.skills-grid h4 {
  font-size: 0.875rem;
  font-weight: 600;
  margin: 0 0 0.25rem;
  color: var(--text);
}
.skills-grid p { margin: 0; font-size: 0.9375rem; color: var(--text-muted); }
.skills-langs,
.skills-interests {
  font-size: 0.9375rem;
  color: var(--text-muted);
  margin: 0.25rem 0 0;
}

/* --- Contact --- */
.contact-intro { margin-bottom: 1.5rem; }
.page-title {
  font-family: var(--font-serif);
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 600;
  margin: 0 0 0.75rem;
  color: var(--text);
}
.contact-lead {
  font-size: 1rem;
  color: var(--text-muted);
  margin: 0;
  max-width: 32rem;
}
.contact-cta { margin: 0; }
.btn-mail {
  display: inline-block;
  font-size: 1.125rem;
  font-weight: 500;
  color: var(--accent);
  padding: 0.5rem 0;
}
.btn-mail:hover { text-decoration: none; color: var(--accent-hover); }
