:root {
  --bg: #131820;
  --panel: #1a212d;
  --line: #283143;
  --text: #e7ebf2;
  --muted: #8e99ad;
  --accent: #6db6f0;
  --accent-strong: #3d7bd9;
  --in-bg: #eef2f7;
  --in-text: #18202c;
  --out-bg: linear-gradient(135deg, #4384e6, #2f62c2);
  --star: #f5c542;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --display: "Space Grotesk", system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
body {
  background: #0a0d12;
  color: var(--text);
  font-family: "Lexend", system-ui, sans-serif;
  font-weight: 300;
  font-size: 9pt;
  line-height: 1.45;
}
ul { list-style: none; }
@media screen { .print-only { display: none !important; } }
a { color: inherit; text-decoration: none; }

/* ---------- Barre d'outils (écran uniquement) ---------- */
.toolbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; justify-content: center; flex-wrap: wrap; gap: 10px;
  padding: 14px 16px;
  background: rgba(10, 13, 18, .85);
  backdrop-filter: blur(8px);
}
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font: 500 14px "Lexend", system-ui, sans-serif;
  color: #fff; background: var(--accent-strong);
  border: 0; border-radius: 999px; padding: 10px 20px; cursor: pointer;
  transition: background .15s;
}
.btn:hover { background: #4b8bee; }
.btn-ghost { background: transparent; box-shadow: inset 0 0 0 1.5px var(--accent-strong); }
.btn-ghost:hover { background: rgba(61, 123, 217, .2); }
.lang-switch { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line); }
.lang-switch button {
  font: 500 13px var(--mono); color: var(--muted);
  background: none; border: 0; border-radius: 999px; padding: 7px 12px; cursor: pointer;
}
.lang-switch button:hover { color: var(--text); }
.lang-switch button[aria-pressed="true"] { background: var(--accent-strong); color: #fff; }
.btn svg { width: 18px; height: 18px; }

/* ---------- Feuille A4 ---------- */
.page {
  width: 210mm;
  min-height: 297mm;
  margin: 24px auto 48px;
  padding: 9mm;
  display: grid;
  grid-template-columns: 64mm 1fr;
  gap: 8mm;
  background:
    radial-gradient(120mm 90mm at 100% 0%, rgba(109, 182, 240, .10), transparent 70%),
    radial-gradient(90mm 90mm at 40% 100%, rgba(61, 123, 217, .08), transparent 70%),
    var(--bg);
  box-shadow: 0 24px 70px rgba(0, 0, 0, .55);
}

/* ---------- Colonne latérale ---------- */
.sidebar {
  grid-column: 1; grid-row: 1;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 5mm;
  padding: 8mm 5.5mm 7mm;
  display: flex; flex-direction: column; gap: 6.5mm;
}
.photo {
  position: relative;
  width: 34mm; height: 34mm; margin: 0 auto 1mm;
  border-radius: 50%;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  font: 700 22pt var(--display); color: #fff;
  box-shadow: 0 0 0 1.6mm var(--panel), 0 0 0 2mm var(--accent);
}
.photo img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover; border-radius: 50%;
}
.side-title {
  display: flex; align-items: center; gap: 2mm;
  margin-bottom: 3mm;
  font: 600 7.5pt var(--display);
  letter-spacing: .25em; text-transform: uppercase;
  color: var(--accent);
}
.side-title::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.contact li { display: flex; align-items: center; gap: 2.5mm; margin-bottom: 2.2mm; font-size: 8.5pt; }
.contact svg { width: 3.8mm; height: 3.8mm; flex: none; color: var(--accent); }

.edu li { display: flex; flex-direction: column; margin-bottom: 3.2mm; }
.edu .year { font: 500 7.5pt var(--mono); color: var(--accent); }
.edu .degree { font-weight: 500; font-size: 8.5pt; text-transform: uppercase; letter-spacing: .03em; }
.edu .school { color: var(--muted); font-size: 8pt; }

.skills h4 {
  margin: 0 0 1.2mm;
  font-weight: 500; font-size: 7pt;
  letter-spacing: .12em; text-transform: uppercase; color: var(--muted);
}
.skills ul { margin-bottom: 3.5mm; }
.skills li { display: flex; align-items: center; gap: 1.8mm; padding: .7mm 0; font-size: 8.5pt; }
.skills li::before { content: "~/"; font: 500 7.5pt var(--mono); color: var(--accent); }
.star { margin-left: auto; width: 3.6mm; height: 3.6mm; fill: var(--star); }

.side-bottom { margin-top: auto; }
.side-bottom .tags { margin-bottom: 4.5mm; }
.side-bottom .tags:last-child { margin-bottom: 0; }
.tags { display: flex; flex-wrap: wrap; gap: 1.6mm; }
.tag {
  padding: .8mm 2.2mm;
  border-radius: 999px;
  background: #242d3e; border: 1px solid var(--line);
  font-size: 8pt;
}

/* ---------- Colonne principale ---------- */
.main { grid-column: 2; grid-row: 1; min-width: 0; display: flex; flex-direction: column; padding-top: 3mm; }

.name {
  font: 700 29pt/1 var(--display);
  letter-spacing: .03em; text-transform: uppercase;
}
.name span { color: var(--accent); }
.role {
  margin-top: 3mm;
  font: 500 10pt var(--mono);
  color: var(--accent);
}
.caret {
  display: inline-block;
  width: .55em; height: 1.05em; margin-left: .25em;
  vertical-align: -.15em;
  background: var(--accent);
  animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }
.summary { margin-top: 4.5mm; color: #c3cbd9; font-size: 9pt; line-height: 1.6; }

.section-title {
  display: flex; align-items: center; gap: 3mm;
  margin: 7mm 0 1mm;
  font: 600 8pt var(--display);
  letter-spacing: .25em; text-transform: uppercase; color: var(--accent);
}
.section-title::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ---------- Fil de discussion ---------- */
.thread { break-inside: avoid; }
.day { text-align: center; margin: 4.5mm 0 2.5mm; }
.day span {
  display: inline-block;
  padding: .7mm 3mm;
  border-radius: 999px;
  background: #1c2432; border: 1px solid var(--line);
  font: 400 7pt var(--mono); color: var(--muted);
}

.msg { display: flex; align-items: flex-end; gap: 2mm; margin-bottom: 2mm; }
.msg.out { justify-content: flex-end; }
.bubble { max-width: 80%; padding: 2.2mm 3.6mm; border-radius: 4mm; }

.avatar {
  flex: none;
  width: 7.5mm; height: 7.5mm; border-radius: 50%;
  display: grid; place-items: center;
  background: #263044; border: 1px solid var(--line);
  font: 600 7.5pt var(--display); color: var(--accent);
}
.in .bubble { background: var(--in-bg); color: var(--in-text); border-bottom-left-radius: 1mm; }
.in strong { display: block; font: 600 9.5pt var(--display); }
.in small { display: block; font-size: 7.5pt; color: #5a6578; }

.out .bubble { background: var(--out-bg); color: #fff; border-bottom-right-radius: 1mm; font-weight: 400; }
.meta { display: flex; justify-content: flex-end; align-items: center; gap: 2mm; margin-top: 1.2mm; font-size: 7pt; }
.stack { padding: .3mm 1.8mm; border-radius: 1mm; background: rgba(255, 255, 255, .16); font-family: var(--mono); }
.bubble summary { list-style: none; cursor: pointer; }
.bubble summary::-webkit-details-marker { display: none; }
.more-hint {
  display: inline-flex; align-items: center; gap: .6mm;
  margin-right: auto;
  opacity: .75; font-size: 7pt;
}
summary:hover .more-hint { opacity: 1; }
.chevron { width: 3mm; height: 3mm; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; transition: transform .2s; }
details[open] .chevron { transform: rotate(180deg); }
.more { margin-top: 2.4mm; padding-top: 2.4mm; border-top: 1px solid rgba(255, 255, 255, .22); font-weight: 300; }
.more li, .detail-mission li { position: relative; padding-left: 3.4mm; margin-bottom: 1.2mm; }
.detail-mission li { margin-bottom: .9mm; }
.more li::before, .detail-mission li::before {
  content: ""; position: absolute; left: .6mm; top: .6em;
  width: 1.2mm; height: 1.2mm; border-radius: 50%;
  background: currentColor; opacity: .7;
}
.ticks { width: 3.6mm; height: 2.6mm; fill: none; stroke: #bfe0ff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.typing .bubble { display: flex; gap: 1.2mm; padding: 2.6mm 3.6mm; opacity: .7; }
.typing i { width: 1.4mm; height: 1.4mm; border-radius: 50%; background: #fff; animation: bounce 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .15s; }
.typing i:nth-child(3) { animation-delay: .3s; }
@keyframes bounce { 0%, 60%, 100% { transform: none; opacity: .5; } 30% { transform: translateY(-.8mm); opacity: 1; } }

/* ---------- Page 2 : réalisations en détail ---------- */
.details-page { display: none; padding: 10mm 9mm; }
.details-header {
  display: flex; justify-content: space-between; align-items: flex-end;
  padding-bottom: 3mm; margin-bottom: 4mm;
  border-bottom: 1px solid var(--line);
}
.details-header h2 { font: 700 18pt/1 var(--display); letter-spacing: .03em; text-transform: uppercase; }
.details-header h2 span { color: var(--accent); }
.details-header p { margin-top: 2mm; font: 500 9pt var(--mono); color: var(--accent); }
.page-num { font: 400 7.5pt var(--mono); color: var(--muted); }

.detail-block { margin-bottom: 4.5mm; break-inside: avoid; }
.detail-company { display: flex; align-items: center; gap: 2.5mm; margin-bottom: 2.5mm; }
.detail-company strong { display: block; font: 600 11pt var(--display); }
.detail-company small { display: block; font-size: 7.5pt; color: var(--muted); }
.detail-company .period {
  margin-left: auto;
  padding: .7mm 3mm; border-radius: 999px;
  background: #1c2432; border: 1px solid var(--line);
  font: 400 7pt var(--mono); color: var(--muted);
}
.detail-missions { display: grid; grid-template-columns: 1fr 1fr; gap: 4mm; }
.detail-mission {
  padding: 3.2mm 4.5mm;
  background: var(--panel); border: 1px solid var(--line); border-radius: 4mm;
  box-shadow: inset 1mm 0 0 var(--accent-strong);
}
.detail-mission h3 { font-weight: 500; font-size: 9pt; line-height: 1.4; }
.detail-mission .stack {
  display: inline-block; margin: 1.5mm 0 2.2mm;
  background: rgba(109, 182, 240, .12); color: var(--accent); font-size: 7pt;
}
.detail-mission ul { font-size: 8pt; line-height: 1.4; color: #c3cbd9; }
.detail-mission li::before { background: var(--accent); opacity: 1; }

/* ---------- Impression / PDF ---------- */
@page { size: A4; margin: 0; }
@media print {
  body { background: var(--bg); }
  .toolbar { display: none; }
  .page { margin: 0; box-shadow: none; height: 297mm; }
  .caret, .typing i { animation: none; }
  .more, .more-hint { display: none; }
  .complete .details-page { display: block; break-before: page; }
}

/* ---------- Image d'aperçu (index.html?og) ---------- */
.og { overflow: hidden; }
.og .toolbar { display: none; }
.og .page { margin: 0; box-shadow: none; zoom: 1.512; }
.og .caret { animation: none; }

/* ---------- Mobile ---------- */
@media screen and (max-width: 860px) {
  body { font-size: 15px; }
  .page {
    width: auto; min-height: 0;
    margin: 0; padding: 16px;
    grid-template-columns: 1fr; gap: 20px;
    box-shadow: none;
  }
  .main, .sidebar { grid-column: auto; grid-row: auto; }
  .name { font-size: 34px; }
}
