/* Minimal editorial style: white page, Cardo headings, Inter body,
   name left / nav right, one narrow centred column. */
:root {
  --ink: #111;
  --muted: #6b6b6b;
  --line: #e5e5e5;
  --paper: #fff;
  --heading: Cardo, Georgia, "Times New Roman", serif;
  --body: Inter, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.6;
}

a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
p { margin: 0 0 1.2em; }

/* Header */
#masthead { padding: 20px 24px; }
.bar {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 24px;
}
#site-title { font-family: var(--heading); font-size: 1.05rem; }
#site-title:hover { text-decoration: none; }

#access { display: flex; gap: 28px; }

.lang { display: flex; gap: 10px; font-size: 0.8rem; letter-spacing: 0.06em; }
.lang-btn {
  appearance: none;
  background: none;
  border: 0;
  padding: 4px 0;
  font-family: var(--body);
  font-size: inherit;
  letter-spacing: inherit;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 1px solid transparent;
}
.lang-btn:hover { color: var(--ink); }
.lang-btn.active { color: var(--ink); border-bottom-color: var(--ink); }
.lang-btn:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.tab {
  appearance: none;
  background: none;
  border: 0;
  padding: 4px 0;
  font-family: var(--body);
  font-size: 0.95rem;
  color: var(--ink);
  cursor: pointer;
  border-bottom: 1px solid transparent;
}
.tab:hover { border-bottom-color: var(--muted); }
.tab.active { border-bottom-color: var(--ink); }
.tab:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

/* Single centred column */
#container {
  max-width: 620px;
  margin: 0 auto;
  padding: 40px 24px 60px;
  min-height: 60vh;
  text-align: center;
}
.panel[hidden] { display: none; }

.portrait {
  display: block;
  width: 100%;
  max-width: 560px;
  height: auto;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  margin: 0 auto 40px;
}

.name, .page-heading {
  font-family: var(--heading);
  font-weight: 400;
  font-size: clamp(1.2rem, 1.2rem + 1.15vw, 1.9rem);
  line-height: 1.3;
  margin: 0 0 12px;
}
.role, .affil, .label, .value { font-family: var(--heading); font-size: 1.05rem; margin: 0 0 6px; }
.label { color: var(--muted); }
.value { margin-bottom: 20px; }
.sep { margin: 28px 0; color: var(--muted); }
.prose { text-align: justify; hyphens: auto; }
.prose p { margin-bottom: 1.2em; }
.value.list { list-style: none; padding: 0; }
.value a { border-bottom: 1px solid var(--ink); }
.value a:hover { text-decoration: none; }

/* Work list */
.work-hint { color: var(--muted); font-size: 0.9rem; }
.work-status { font-size: 0.9rem; color: var(--muted); padding: 10px 0; }
.work-status.error { color: var(--ink); }

.work-list { list-style: none; margin: 0; padding: 0; text-align: left; }
.doc-card { padding: 20px 0; border-top: 1px solid var(--line); }
.doc-card:last-child { border-bottom: 1px solid var(--line); }
.doc-row { display: flex; align-items: baseline; gap: 14px; }
.doc-stamp {
  flex: 0 0 auto;
  min-width: 44px;
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.doc-info { flex: 1 1 auto; min-width: 0; }
.doc-title { font-family: var(--heading); font-size: 1.15rem; margin: 0 0 2px; word-break: break-word; }
.doc-meta { font-size: 0.78rem; color: var(--muted); margin: 0; }
.doc-open { flex: 0 0 auto; font-size: 0.85rem; white-space: nowrap; border-bottom: 1px solid var(--ink); }
.doc-open:hover { text-decoration: none; color: var(--muted); border-color: var(--muted); }

.doc-audio { width: 100%; height: 36px; margin-top: 12px; }
.doc-video { width: 100%; max-height: 360px; margin-top: 12px; background: #000; }
.doc-thumb { display: block; max-width: 100%; max-height: 420px; margin-top: 12px; }
.doc-preview { display: block; width: fit-content; max-width: 100%; margin-top: 12px; border: 1px solid var(--line); }
.doc-preview:not(.ready) { width: 200px; height: 260px; }
.doc-preview { cursor: pointer; transition: border-color 0.15s, box-shadow 0.15s; }
.doc-preview.ready:hover { border-color: var(--muted); box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12); }
.doc-card.has-preview .doc-open { display: none; }
.doc-title a { color: inherit; }
.doc-title a:hover { text-decoration: underline; }
.doc-preview canvas { display: block; max-width: 100%; max-height: 420px; width: auto; height: auto; }
/* Wider than the 620px column so CV text stays legible */
.cv-pages {
  position: relative;
  left: 50%;
  transform: translateX(-50%);
  width: min(820px, calc(100vw - 48px));
  margin-top: 20px;
  background: #fff;
  border: 1px solid var(--line);
}
.cv-pages.error { font-size: 0.9rem; color: var(--muted); }
.cv-page { display: block; width: 100%; height: auto; margin: 0; border: 0; }
.doc-pdf { display: block; width: 100%; height: 560px; margin-top: 12px; border: 0; }

/* Footer */
#footer { text-align: center; font-size: 0.8rem; color: var(--muted); padding: 24px; }
#footer p { margin: 0; }

@media (max-width: 600px) {
  #access { gap: 18px; }
  .doc-row { flex-wrap: wrap; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}
