/* v6: jrosser-inspired — JetBrains Mono body, icon socials, timeline résumé */

:root {
  --bg: #fafaf9;
  --bg-soft: #efeee9;
  --text: #1d2025;
  --text-muted: #5b6068;
  --text-faint: #8a8e96;
  --rule: #dad7d0;
  --link: #0ea5e9;
  --link-hover: #0284c7;
  --accent: #0ea5e9;
  --accent-soft: #38bdf8;
  --timeline-line: #d8d4cc;

  --mono: 'JetBrains Mono', 'Fira Code', 'SF Mono', Menlo, Consolas, monospace;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

[data-theme='dark'] {
  --bg: #16181c;
  --bg-soft: #1f2126;
  --text: #e6e3dd;
  --text-muted: #a8a29a;
  --text-faint: #706d68;
  --rule: #2c2f35;
  --link: #38bdf8;
  --link-hover: #7dd3fc;
  --accent: #38bdf8;
  --accent-soft: #7dd3fc;
  --timeline-line: #2c2f35;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--link);
  text-decoration: none;
  transition: color 0.15s;
}

a:hover {
  color: var(--link-hover);
  text-decoration: underline;
  text-underline-offset: 3px;
}

p { margin: 0 0 12px; }
em { font-style: italic; }
strong { font-weight: 600; }

/* ============ Theme toggle ============ */
.theme-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 36px;
  height: 36px;
  border-radius: 6px;
  border: 1px solid var(--rule);
  background: var(--bg);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  z-index: 10;
  transition: background-color 0.15s, color 0.15s;
}

.theme-toggle:hover {
  background: var(--bg-soft);
  color: var(--text);
}

[data-theme='light'] .theme-icon-dark,
[data-theme='dark'] .theme-icon-light { display: none; }

main {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 28px 60px;
}

/* ============ Hero ============ */
.hero {
  display: grid;
  grid-template-columns: 1fr 200px;
  gap: 32px;
  align-items: center;
  padding: 36px 0 16px;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 18px;
}

.hero h1 {
  font-family: var(--mono);
  font-size: 2.1rem;
  font-weight: 700;
  margin: 0 0 4px;
  letter-spacing: -0.02em;
  color: var(--text);
}

.hero .title {
  font-family: var(--mono);
  font-size: 0.96rem;
  color: var(--accent);
  margin: 0 0 6px;
  font-weight: 500;
}

.hero .dept {
  font-family: var(--mono);
  font-size: 0.84rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.55;
}

.hero-photo img {
  width: 200px;
  height: 240px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--rule);
  display: block;
}

/* ============ Two-column layout ============ */
.layout {
  display: grid;
  grid-template-columns: 230px 1fr;
  gap: 44px;
  align-items: start;
}

/* ============ Sidebar ============ */
.sidebar {
  position: sticky;
  top: 24px;
  font-size: 0.85rem;
}

.side-h {
  font-family: var(--mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--text-faint);
  font-weight: 700;
  margin: 0 0 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--rule);
}

.side-h:not(:first-child) { margin-top: 24px; }

.side-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.side-list li {
  padding: 2px 0;
  line-height: 1.5;
}

.side-list a {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  padding: 4px 0;
}

.side-list a:hover {
  color: var(--accent);
  text-decoration: none;
}

.side-list .icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--text-muted);
  transition: color 0.15s;
}

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

.side-list.small {
  font-size: 0.82rem;
}

.side-list.small li {
  color: var(--text-muted);
  padding: 3px 0;
  line-height: 1.5;
}

/* ============ Main content ============ */
.section {
  margin-bottom: 42px;
}

.content h2 {
  font-family: var(--mono);
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0 0 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--rule);
  color: var(--text);
  position: relative;
  letter-spacing: -0.005em;
}

.content h2::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 36px;
  height: 2px;
  background: var(--accent);
}

.content h4 {
  font-family: var(--mono);
  font-size: 0.98rem;
  font-weight: 700;
  margin: 0 0 4px;
  line-height: 1.4;
  color: var(--text);
  letter-spacing: -0.005em;
}

.content p {
  font-size: 0.92rem;
  margin: 0 0 12px;
  line-height: 1.7;
}

/* ============ News ============ */
.news {
  list-style: none;
  padding: 0;
  margin: 0;
}

.news li {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 14px;
  padding: 5px 0;
  border-bottom: 1px dotted var(--rule);
  align-items: baseline;
  font-size: 0.9rem;
}

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

.ndate {
  font-weight: 700;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  font-size: 0.82rem;
}

/* ============ Bullets (Research) ============ */
.bullets {
  margin: 6px 0 0;
  padding-left: 22px;
  font-size: 0.92rem;
}

.bullets li {
  padding: 3px 0;
  color: var(--text);
  line-height: 1.6;
}

.bullets li::marker { color: var(--accent); }

/* ============ Publications ============ */
.pub {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 15px;
  padding: 10px 0;
  align-items: start;
}

.pub-img {
  width: 96px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pub-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.pub-meta h4 {
  font-size: 0.92rem;
  line-height: 1.35;
  margin: 0 0 3px;
}

.pub-meta .auth {
  font-size: 0.8rem;
  line-height: 1.4;
  color: var(--text-muted);
  margin: 0 0 3px;
}

.pub-meta .ven {
  font-size: 0.8rem;
  line-height: 1.4;
  color: var(--text-muted);
  margin: 0;
}

.pub-meta .ven em { font-style: normal; }

.pub-meta .ven .vname { margin-right: 10px; }

.pub-meta .ven a {
  display: inline-block;
  padding: 1px 8px;
  margin-right: 8px;
  border: 1px solid var(--rule);
  border-radius: 3px;
  color: var(--text-muted);
  font-size: 0.76rem;
  transition: all 0.15s;
}

.pub-meta .ven a:hover {
  color: var(--accent);
  border-color: var(--accent);
  text-decoration: none;
  background: var(--bg-soft);
}

.pub-meta .desc {
  font-size: 0.88rem;
  color: var(--text);
  margin: 0 0 8px;
  line-height: 1.6;
}

/* ============ Projects ============ */
.projects {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 0.9rem;
}

.projects li {
  padding: 5px 0;
  border-bottom: 1px dotted var(--rule);
}

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

.muted {
  color: var(--text-faint);
  font-size: 0.82rem;
}

.muted-inline {
  color: var(--text-faint);
  font-size: 0.85em;
  font-weight: 400;
}

/* ============ Timeline / Résumé ============ */
.timeline {
  list-style: none;
  padding: 0;
  margin: 8px 0 0;
  position: relative;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 92px;
  top: 8px;
  bottom: 8px;
  width: 1px;
  background: var(--timeline-line);
}

.timeline li {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 28px;
  padding: 10px 0 14px;
  position: relative;
}

.timeline .tdate {
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  padding-top: 3px;
  text-align: right;
  padding-right: 14px;
}

.timeline li::after {
  content: '';
  position: absolute;
  left: 88px;
  top: 16px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent);
  z-index: 1;
}

.timeline .titem {
  padding-left: 14px;
}

.timeline h4 {
  font-size: 0.95rem;
  margin-bottom: 4px;
}

.timeline .role-inline {
  font-weight: 400;
  color: var(--text-muted);
  font-size: 0.88rem;
  font-style: italic;
}

.timeline .org {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0 0 6px;
  font-style: italic;
}

.timeline .bdesc {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.6;
}

/* ============ Footer ============ */
footer {
  margin-top: 36px;
  padding-top: 22px;
  border-top: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--text-faint);
  text-align: center;
}

footer p { margin: 0; }

/* ============ Responsive ============ */
@media (max-width: 820px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 18px;
    text-align: center;
    padding-top: 28px;
  }

  .hero-photo img {
    width: 140px;
    height: 168px;
    margin: 0 auto;
  }

  .hero h1 { font-size: 1.7rem; }

  .layout {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .sidebar {
    position: static;
    order: 2;
    padding-top: 16px;
    border-top: 1px solid var(--rule);
  }


  .timeline::before { left: 6px; }
  .timeline li {
    grid-template-columns: 1fr;
    gap: 4px;
    padding-left: 24px;
  }
  .timeline .tdate { text-align: left; padding-right: 0; padding-left: 0; }
  .timeline li::after { left: 2px; top: 14px; }
  .timeline .titem { padding-left: 0; }
}

/* ============ Sync (PAT) modal ============ */
.sync-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 20px;
  animation: syncFadeIn 0.15s ease-out;
}
[data-theme='dark'] .sync-modal-overlay { background: rgba(0, 0, 0, 0.65); }
@keyframes syncFadeIn { from { opacity: 0; } to { opacity: 1; } }

.sync-modal {
  background: var(--bg);
  border: 1px solid var(--rule);
  border-radius: 8px;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  font-family: var(--mono);
  color: var(--text);
}
.sync-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--rule);
}
.sync-modal-header h3 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.sync-modal-close {
  background: transparent;
  border: none;
  color: var(--text-faint);
  font-size: 1.4rem;
  cursor: pointer;
  line-height: 1;
  padding: 0 4px;
  transition: color 0.15s;
}
.sync-modal-close:hover { color: var(--text); }
.sync-modal-body {
  padding: 16px 18px;
  font-size: 0.82rem;
  line-height: 1.65;
}
.sync-modal-body p { margin: 0 0 12px; color: var(--text-muted); }
.sync-modal-body ol {
  margin: 0 0 14px;
  padding-left: 22px;
  color: var(--text-muted);
}
.sync-modal-body ol li { margin: 4px 0; }
.sync-modal-body code {
  background: var(--bg-soft);
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: 0 4px;
  font-size: 0.78rem;
}
.sync-pat-input {
  width: 100%;
  padding: 9px 12px;
  background: var(--bg-soft);
  border: 1px solid var(--rule);
  border-radius: 4px;
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.82rem;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.15s;
  margin-bottom: 12px;
}
.sync-pat-input:focus { border-color: var(--accent); }
.sync-modal-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}
.sync-modal-btn {
  background: transparent;
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 6px 14px;
  color: var(--text-muted);
  font-family: var(--mono);
  font-size: 0.78rem;
  cursor: pointer;
  transition: all 0.15s;
}
.sync-modal-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
}
.sync-modal-btn.primary {
  color: var(--accent);
  border-color: var(--accent);
}
.sync-modal-btn.primary:hover { background: var(--bg-soft); }
.sync-modal-note {
  font-size: 0.72rem !important;
  color: var(--text-faint) !important;
  margin: 14px 0 0 !important;
  padding-top: 10px;
  border-top: 1px dotted var(--rule);
  line-height: 1.6;
}

/* ============ Sync status indicator ============ */
.sync-status {
  font-family: var(--mono);
  font-size: 0.74rem;
  color: var(--text-faint);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 4px;
}
.sync-status.dirty { color: #f59e0b; }
.sync-status.synced { color: var(--accent); }
.sync-status.error { color: #ef4444; }
.sync-status .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  display: inline-block;
}

