:root {
  --page-width: 720px;
  --text: #1a1a1a;
  --text-secondary: #5c5c5c;
  --text-tertiary: #8a8a8a;
  --bg: #f5f0eb;
  --surface: #faf8f5;
  --border: #ddd6cc;
  --accent: #c4653a;
  --font-serif: 'Instrument Serif', Georgia, 'Times New Roman', serif;
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'IBM Plex Mono', 'Menlo', monospace;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ── Language toggle ───────────────────────────────── */

.lang-toggle {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 100;
  display: flex;
  border: 1.5px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
  background: var(--surface);
}

.lang-btn {
  padding: 0.35rem 0.65rem;
  font-size: 0.7rem;
  font-weight: 600;
  font-family: var(--font-mono);
  letter-spacing: 0.05em;
  border: none;
  background: transparent;
  color: var(--text-tertiary);
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease;
}

.lang-btn:not(:last-child) {
  border-right: 1.5px solid var(--border);
}

.lang-btn[aria-pressed="true"] {
  background: var(--text);
  color: var(--surface);
}

.lang-btn:hover:not([aria-pressed="true"]) {
  background: var(--border);
  color: var(--text);
}

/* ── Page layout ───────────────────────────────────── */

.page {
  margin-inline: auto;
  max-width: var(--page-width);
  padding: 5rem 2.5rem 4rem;
}

/* ── Footer ────────────────────────────────────────── */

.page-footer {
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1.5px solid var(--border);
  display: flex;
  justify-content: center;
}

.footer-actions {
  display: inline-flex;
  align-items: center;
  gap: 2rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.02em;
}

.footer-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  transition: color 120ms ease;
}

.footer-link:hover {
  color: var(--accent);
}

/* ── Typography ────────────────────────────────────── */

h1, h2, h3 {
  margin: 0;
}

h1 {
  font-family: var(--font-serif);
  font-size: 3.25rem;
  font-weight: 400;
  font-style: italic;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--text);
}

h2 {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-tertiary);
  margin-bottom: 1.5rem;
}

h3 {
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}

p {
  margin: 0;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 120ms ease;
}

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

/* ── Sections ──────────────────────────────────────── */

section + section {
  margin-top: 3.5rem;
  padding-top: 3.5rem;
  border-top: 1.5px solid var(--border);
}

/* ── Hero ──────────────────────────────────────────── */

.hero {
  padding-bottom: 3.5rem;
  border-bottom: 1.5px solid var(--border);
}

.hero-header {
  margin-bottom: 1.75rem;
}

.tagline {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  margin-top: 0.75rem;
}

.summary {
  font-size: 0.95rem;
  line-height: 1.75;
  color: var(--text-secondary);
  margin-top: 1.5rem;
  max-width: 600px;
}

.contact {
  list-style: none;
  padding: 0;
  margin: 2rem 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 2rem;
}

.contact li {
  font-size: 0.8rem;
  font-family: var(--font-mono);
  color: var(--text-secondary);
  letter-spacing: 0.01em;
}

.contact a {
  color: var(--text-secondary);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 120ms ease, color 120ms ease;
}

.contact a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.contact-label {
  font-weight: 600;
  color: var(--text);
}

/* ── Skills ────────────────────────────────────────── */

.skills-list {
  display: grid;
  gap: 1rem;
}

.skill-row {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 1.25rem;
  align-items: baseline;
}

.skill-row h3 {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.02em;
}

.skill-items {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* ── Experience ────────────────────────────────────── */

.entry + .entry {
  margin-top: 2.5rem;
}

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

.entry h3 {
  font-size: 0.95rem;
  font-weight: 600;
}

.entry .role-title {
  font-weight: 400;
  color: var(--text-secondary);
}

.entry .meta {
  font-family: var(--font-mono);
  color: var(--text-tertiary);
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.entry-summary {
  margin-top: 0.5rem;
  font-size: 0.875rem;
  line-height: 1.7;
  color: var(--text-secondary);
}

.entry ul {
  margin: 0.5rem 0 0;
  padding-left: 1.25rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

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

.entry li::marker {
  color: var(--border);
}

/* ── Credentials ───────────────────────────────────── */

.credentials-list {
  display: grid;
  gap: 1rem;
}

.credential-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
}

.credential-row h3 {
  font-size: 0.9rem;
}

.credential-issuer {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-tertiary);
  letter-spacing: 0.02em;
  white-space: nowrap;
}

/* ── Education ─────────────────────────────────────── */

.education-entry + .education-entry {
  margin-top: 1rem;
}

.education-entry h3 {
  font-size: 0.9rem;
}

.education-entry .meta {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-tertiary);
  letter-spacing: 0.02em;
  margin-top: 0.15rem;
}

/* ── Extras ────────────────────────────────────────── */

.extras-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  gap: 2.5rem;
}

.extras-list li {
  font-size: 0.875rem;
  color: var(--text-secondary);
}



/* ── Top navigation tabs ───────────────────────────── */

.top-tabs {
  position: sticky;
  top: 1.25rem;
  z-index: 80;
  display: inline-flex;
  gap: 0.4rem;
  padding: 0.3rem;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(8px);
  margin-bottom: 2.5rem;
}

.top-tab {
  border: none;
  border-radius: 999px;
  padding: 0.5rem 0.95rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  background: transparent;
  cursor: pointer;
  transition: color 140ms ease, background 140ms ease;
}

.top-tab[aria-pressed="true"] {
  background: var(--text);
  color: var(--surface);
}

.top-tab:hover:not([aria-pressed="true"]) {
  color: var(--text);
  background: var(--border);
}

.view-panel[hidden] {
  display: none;
}

/* ── Publications ──────────────────────────────────── */

.publications-status {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--text-tertiary);
  margin-bottom: 1rem;
}

.publications-list {
  display: grid;
  gap: 1.25rem;
}

.publication-card {
  border: 1.5px solid var(--border);
  background: var(--surface);
  padding: 1.15rem 1.2rem;
}

.publication-card h3 {
  font-size: 1rem;
  line-height: 1.35;
}

.publication-meta {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-tertiary);
  margin-top: 0.5rem;
  letter-spacing: 0.02em;
}

.publication-summary {
  margin-top: 0.75rem;
  font-size: 0.88rem;
  line-height: 1.7;
  color: var(--text-secondary);
}

.publication-link {
  display: inline-block;
  margin-top: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.03em;
}

/* ── Responsive ────────────────────────────────────── */

@media (max-width: 768px) {
  .page {
    padding: 4rem 1.75rem 3rem;
  }

  .top-tabs {
    top: 1rem;
    margin-bottom: 2rem;
  }

  h1 {
    font-size: 2.5rem;
  }

  .credential-row {
    flex-direction: column;
    gap: 0.1rem;
  }
}

@media (max-width: 520px) {
  .page {
    padding: 3.5rem 1.25rem 2.5rem;
  }

  .top-tabs {
    width: 100%;
    justify-content: center;
  }

  h1 {
    font-size: 2rem;
  }

  .skill-row {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }

  .contact {
    flex-direction: column;
    gap: 0.4rem;
  }

  .entry header {
    flex-direction: column;
    gap: 0.2rem;
  }

  .extras-list {
    flex-direction: column;
    gap: 0.5rem;
  }

  .lang-toggle {
    top: 1rem;
    right: 1rem;
  }
}
