/* David Massenot — one-page resume. No framework, no build. */

:root {
  --bg: #fbfbfd;
  --surface: #ffffff;
  --text: #1c2230;
  --muted: #5b6475;
  --line: #e3e7ee;
  --accent: #1172c4;
  --accent-soft: #e8f2fb;
  --tag-bg: #f1f3f7;
  --shadow: 0 1px 2px rgb(16 24 40 / .05), 0 4px 16px rgb(16 24 40 / .04);
  --radius: 14px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f131a;
    --surface: #161b24;
    --text: #e6e9ef;
    --muted: #9aa3b2;
    --line: #262d3a;
    --accent: #5aa9ec;
    --accent-soft: #15283b;
    --tag-bg: #1d2430;
    --shadow: none;
  }
}

/* Language switch: only the active language's blocks are shown. */
[data-lang="en"] [data-l="fr"],
[data-lang="fr"] [data-l="en"] { display: none !important; }

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

html { scroll-behavior: smooth; scroll-padding-top: 72px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.wrap { width: 100%; max-width: 880px; margin: 0 auto; padding: 0 16px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.print-only { display: none !important; }

.skip { position: absolute; left: 16px; top: -48px; background: var(--accent); color: #fff; padding: 8px 12px; border-radius: 8px; z-index: 20; }
.skip:focus { top: 8px; }

/* Top bar */
.topbar {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner { display: flex; align-items: center; gap: 16px; height: 56px; }
.brand { font-weight: 800; letter-spacing: .04em; text-decoration: none; color: var(--text); }
.menu { display: flex; gap: 4px; list-style: none; margin: 0 auto 0 0; padding: 0; }
.menu a { display: block; padding: 6px 10px; border-radius: 8px; color: var(--muted); text-decoration: none; font-size: .92rem; }
.menu a:hover { color: var(--text); background: var(--tag-bg); }
.lang { display: flex; border: 1px solid var(--line); border-radius: 999px; padding: 2px; }
.lang button {
  font: inherit; font-size: .8rem; font-weight: 700; letter-spacing: .04em;
  border: 0; background: none; color: var(--muted); padding: 4px 10px; border-radius: 999px; cursor: pointer;
}
.lang button[aria-pressed="true"] { background: var(--accent); color: #fff; }

/* Hero */
.hero { display: flex; gap: 28px; align-items: flex-start; padding-top: 48px; padding-bottom: 16px; }
.avatar { flex: none; width: 112px; height: 112px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 4px var(--surface), 0 0 0 5px var(--line); }
h1 { margin: 0; font-size: clamp(2rem, 5vw, 2.75rem); line-height: 1.1; letter-spacing: -.02em; }
.title { margin: 6px 0 14px; color: var(--accent); font-weight: 600; }
.profile { margin: 0 0 16px; color: var(--muted); max-width: 62ch; }
.contact { display: flex; flex-wrap: wrap; gap: 6px 18px; list-style: none; margin: 0 0 18px; padding: 0; font-size: .93rem; }
.contact .ico { display: inline-block; min-width: 1.4em; color: var(--muted); font-size: .85em; font-weight: 700; }
.downloads { display: flex; flex-wrap: wrap; gap: 10px; margin: 0; }
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 10px; font-size: .9rem; font-weight: 600; text-decoration: none;
  background: var(--accent-soft); color: var(--accent); border: 1px solid transparent;
}
.btn:hover { border-color: var(--accent); }

/* Sections */
section { padding-top: 40px; }
h2 {
  margin: 0 0 20px; font-size: .8rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--accent);
  display: flex; align-items: center; gap: 12px;
}
h2::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* Timeline */
.timeline { list-style: none; margin: 0; padding: 0 0 0 26px; position: relative; }
.timeline::before { content: ""; position: absolute; left: 6px; top: 8px; bottom: 8px; width: 2px; background: var(--line); border-radius: 2px; }
.job {
  position: relative; margin-bottom: 18px; padding: 18px 20px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
.job::before {
  content: ""; position: absolute; left: -26px; top: 24px; width: 14px; height: 14px; border-radius: 50%;
  background: var(--bg); border: 3px solid var(--line);
}
.job.current::before { border-color: var(--accent); background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.when { margin: 0; font-size: .82rem; font-weight: 600; color: var(--muted); letter-spacing: .02em; }
.job h3 { margin: 2px 0 0; font-size: 1.12rem; line-height: 1.35; }
.org { margin: 0; color: var(--muted); font-size: .95rem; }
.summary { margin: 10px 0 0; }
.points { margin: 10px 0 0; padding-left: 1.1em; }
.points li { margin: 3px 0; }
.points li::marker { color: var(--accent); }

.phase { margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--line); }
.phase h4 { margin: 0; font-size: 1rem; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.phase-when { font-size: .8rem; font-weight: 600; color: var(--muted); }

.tags { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 12px 0 0; padding: 0; }
.tags li { font-size: .78rem; padding: 2px 9px; border-radius: 999px; background: var(--tag-bg); color: var(--muted); white-space: nowrap; }

.compact .job { padding: 14px 18px; margin-bottom: 12px; }
.compact .job::before { top: 20px; }
.compact h3 { font-size: 1rem; }

/* Skills */
.skills { margin: 0; display: grid; gap: 14px; }
.skills > div { display: grid; grid-template-columns: 150px 1fr; gap: 12px; align-items: baseline; }
.skills dt { font-weight: 700; font-size: .92rem; }
.skills dd { margin: 0; }
.skills .tags { margin: 0; }

/* Languages & interests */
.more { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 32px; }
.more h3 { margin: 0 0 4px; font-size: .8rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }
.more p { margin: 0; color: var(--muted); }

.footer { padding-top: 48px; padding-bottom: 32px; color: var(--muted); font-size: .85rem; }

/* Small screens */
@media (max-width: 640px) {
  .hero { flex-direction: column; gap: 16px; padding-top: 28px; }
  .avatar { width: 88px; height: 88px; }
  .menu a { padding: 6px 7px; font-size: .86rem; }
  .brand { display: none; }
  .job { padding: 16px; }
  .skills > div { grid-template-columns: 1fr; gap: 6px; }
  .more { grid-template-columns: 1fr; }
}

/* Print / PDF export: compact A4, no chrome, no photo, light colours. */
@media print {
  @page { size: A4; margin: 10mm 13mm; }
  :root {
    --bg: #fff; --surface: #fff; --text: #1c2230; --muted: #4d5566; --line: #dfe3ea;
    --accent: #1172c4; --accent-soft: #e8f2fb; --tag-bg: #f1f3f7; --shadow: none;
  }
  html { font-size: 9.2pt; }
  body { font-size: 1rem; line-height: 1.42; }
  .contact a[data-print] { font-size: 0; }
  .contact a[data-print]::after { content: attr(data-print); font-size: 9pt; }
  .no-print, .avatar, .skip { display: none !important; }
  .print-only { display: list-item !important; }
  .contact .print-only { display: block !important; }
  .wrap { max-width: none; padding: 0; }
  .hero { padding-top: 0; padding-bottom: 0; }
  h1 { font-size: 22pt; }
  .title { margin: 2px 0 6px; }
  .profile { max-width: none; margin-bottom: 8px; }
  .contact { margin-bottom: 0; font-size: 9pt; }
  .contact a { color: var(--text); text-decoration: none; }
  section { padding-top: 14px; }
  h2 { margin-bottom: 8px; }
  .timeline { padding-left: 18px; }
  .timeline::before { left: 4px; }
  .job { padding: 0 0 0 4px; margin-bottom: 8px; border: 0; border-radius: 0; }
  .when, .job h3, .org { break-after: avoid; }
  .points li, .tags { break-inside: avoid; }
  .job::before { left: -18px; top: 4px; width: 10px; height: 10px; border-width: 2px; }
  .job.current::before { box-shadow: none; }
  .phase { margin-top: 8px; padding-top: 6px; break-inside: avoid; }
  .points { margin-top: 4px; }
  .points li { margin: 1px 0; }
  .tags { margin-top: 5px; gap: 4px; }
  .tags li { font-size: 7.6pt; padding: 0 7px; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .compact .job { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 10px; padding: 0 0 0 4px; margin-bottom: 3px; }
  .compact .job::before { top: 3px; }
  .compact .when { min-width: 72px; }
  .compact h3 { margin: 0; font-size: 1rem; }
  h2 { break-after: avoid; }
  .skills { gap: 5px; }
  .skills > div { grid-template-columns: 110px 1fr; }
  .more { gap: 8px 24px; }
  a { color: inherit; }
}
