:root {
  --radius: 10px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, Cantarell, "Noto Sans", sans-serif;
}

[data-theme="dark"] {
  --bg: #0f1419;
  --surface: #1a2332;
  --text: #e7ecf3;
  --muted: #8b9cb3;
  --accent: #6eb5ff;
  --border: #2d3a4d;
  --social-bg: #1e2838;
  --social-hover: #252f42;
  --placeholder-bg: #2d3a4d;
  --placeholder-fg: #b8c5d6;
}

[data-theme="light"] {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --text: #1a1d21;
  --muted: #5c6570;
  --accent: #0b6bcb;
  --border: #d8dde4;
  --social-bg: #eef1f5;
  --social-hover: #e2e7ee;
  --placeholder-bg: #d8dde4;
  --placeholder-fg: #5c6570;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
}

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

a:hover {
  text-decoration: underline;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.wrap {
  width: min(40rem, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2rem 0 3rem;
}

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 1.5rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}

.site-header h1 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 600;
}

.site-header h1 a {
  color: var(--text);
}

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

.site-header__actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.nav {
  display: flex;
  gap: 0.25rem;
}

.nav__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius);
  color: var(--muted);
  text-decoration: none;
}

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

.nav__link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.nav__icon {
  font-size: 1.1rem;
}

/* Hidden until theme.js adds class "js" on <html> (no dead control without JS). */
.theme-toggle {
  display: none;
}

html.js .theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

html.js .theme-toggle:hover {
  color: var(--accent);
  background: var(--social-bg);
}

html.js .theme-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.theme-toggle__icon {
  font-size: 1.1rem;
}

[data-theme="dark"] .theme-toggle__icon--when-light {
  display: none;
}

[data-theme="light"] .theme-toggle__icon--when-dark {
  display: none;
}

/* PaperMod-style profile (home) */
.profile {
  text-align: center;
  padding: 1rem 0 2rem;
}

.profile__avatar-wrap {
  margin: 0 auto 1.25rem;
  width: 140px;
  height: 140px;
}

.profile__avatar {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--border);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);
}

[data-theme="dark"] .profile__avatar {
  box-shadow: 0 4px 28px rgba(0, 0, 0, 0.35);
}

.profile__avatar--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--placeholder-bg);
  color: var(--placeholder-fg);
  font-size: 2.5rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.profile__initials {
  line-height: 1;
  text-transform: uppercase;
}

.profile__name {
  margin: 0 0 0.35rem;
  font-size: 1.75rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.profile__subtitle {
  margin: 0 0 1.5rem;
  color: var(--muted);
  font-size: 1rem;
}

.profile-socials {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.65rem;
}

.social-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  background: var(--social-bg);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 1.15rem;
  text-decoration: none;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.social-icon:hover {
  text-decoration: none;
  border-color: var(--accent);
  background: var(--social-hover);
  color: var(--accent);
}

.social-icon:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.profile__cta {
  margin: 2rem 0 0;
  font-size: 0.95rem;
}

.profile__cta a {
  font-weight: 500;
}

/* CV as single post */
.post {
  max-width: 48rem;
  margin: 0 auto;
}

.post__title {
  margin: 0 0 0.25rem;
  font-size: 1.85rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.post__subtitle {
  margin: 0 0 0.75rem;
  color: var(--muted);
  font-size: 1.05rem;
}

.post__meta {
  margin: 0;
  padding: 0 0 1rem;
  list-style: none;
  color: var(--muted);
  font-size: 0.95rem;
  border-bottom: 1px solid var(--border);
}

.post__meta li {
  margin-bottom: 0.2rem;
}

.post__lead {
  margin-top: 1.25rem;
  margin-bottom: 0;
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--text);
}

.cv-top {
  margin-bottom: 2rem;
}

.cv-summary {
  max-width: 42em;
}

section.cv-section {
  margin-bottom: 2rem;
  padding-top: 0.25rem;
}

section.cv-section h3 {
  margin: 0 0 0.85rem;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.job,
.edu-item,
.project-item,
.cert-item {
  margin-bottom: 1.35rem;
}

.job:last-child,
.edu-item:last-child,
.project-item:last-child,
.cert-item:last-child {
  margin-bottom: 0;
}

.job-title {
  font-weight: 600;
  margin: 0 0 0.15rem;
  font-size: 1rem;
  line-height: inherit;
}

.job-org {
  margin: 0 0 0.15rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.job-dates {
  margin: 0 0 0.5rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.job ul,
.cv-section ul {
  margin: 0.35rem 0 0;
  padding-left: 1.2rem;
}

.job li,
.cv-section li {
  margin-bottom: 0.35rem;
}

.skill-group {
  margin-bottom: 0.85rem;
}

.skill-group:last-child {
  margin-bottom: 0;
}

.skill-cat {
  font-weight: 600;
  font-size: 0.95rem;
  margin: 0 0 0.25rem;
  line-height: inherit;
}

.skill-items {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.site-footer {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--muted);
  text-align: center;
}

.site-footer__legal-link {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.site-footer__legal-link:hover {
  color: var(--text);
}

.site-footer__legal-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.cta-inline {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  text-align: center;
}

.cta-inline a {
  font-weight: 500;
}
