/* =========================================================
   CV — Ralph Gaume · thème tech sobre, accents mauve sombre
   ========================================================= */

:root {
  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "JetBrains Mono", "SFMono-Regular", "Cascadia Code", Menlo, Consolas, monospace;
  --radius: 12px;
  --radius-sm: 8px;
  --maxw: 1080px;
  --gutter: clamp(16px, 4vw, 32px);
  --ease: cubic-bezier(.2, .7, .2, 1);

  /* Thème sombre (par défaut) */
  --bg: #0f0c14;
  --bg-2: #14101b;
  --surface: #1a1522;
  --surface-2: #211a2b;
  --border: #2c2438;
  --text: #ece7f3;
  --muted: #a69eb3;
  --accent: #b994f2;          /* mauve lisible sur fond sombre */
  --accent-strong: #6a3aa8;   /* mauve sombre — fonds/boutons */
  --accent-strong-hover: #7a48bc;
  --accent-soft: rgba(150, 100, 220, .14);
  --accent-line: rgba(185, 148, 242, .35);
  --on-accent: #ffffff;
  --grid: rgba(185, 148, 242, .05);
  --shadow: 0 10px 30px -12px rgba(0, 0, 0, .6);
  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f7f5fa;
    --bg-2: #f0ecf5;
    --surface: #ffffff;
    --surface-2: #f6f2fb;
    --border: #e2dcea;
    --text: #1b1622;
    --muted: #5c5468;
    --accent: #5b2a91;
    --accent-strong: #5b2a91;
    --accent-strong-hover: #4a2178;
    --accent-soft: rgba(91, 42, 145, .08);
    --accent-line: rgba(91, 42, 145, .3);
    --grid: rgba(91, 42, 145, .05);
    --shadow: 0 10px 30px -14px rgba(40, 20, 70, .25);
    color-scheme: light;
  }
}
:root[data-theme="light"] {
  --bg: #f7f5fa;
  --bg-2: #f0ecf5;
  --surface: #ffffff;
  --surface-2: #f6f2fb;
  --border: #e2dcea;
  --text: #1b1622;
  --muted: #5c5468;
  --accent: #5b2a91;
  --accent-strong: #5b2a91;
  --accent-strong-hover: #4a2178;
  --accent-soft: rgba(91, 42, 145, .08);
  --accent-line: rgba(91, 42, 145, .3);
  --grid: rgba(91, 42, 145, .05);
  --shadow: 0 10px 30px -14px rgba(40, 20, 70, .25);
  color-scheme: light;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--text);
  background-color: var(--bg);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 40px 40px;
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; height: auto; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
h1, h2, h3 { line-height: 1.2; margin: 0; letter-spacing: -.01em; }
p { margin: 0 0 1em; }
ul, ol { margin: 0; padding: 0; list-style: none; }
.mono { font-family: var(--font-mono); }
.muted { color: var(--muted); }
.accent { color: var(--accent); }
.icon { width: 1.1em; height: 1.1em; flex: none; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--accent-strong); color: var(--on-accent);
  padding: .6em 1em; border-radius: var(--radius-sm); text-decoration: none;
  transition: top .2s var(--ease);
}
.skip-link:focus { top: 12px; }

.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
.container.narrow { max-width: 820px; }

/* ---------- Barre de navigation ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner { display: flex; align-items: center; gap: 1.5rem; height: 60px; }
.brand { color: var(--text); text-decoration: none; font-weight: 600; font-size: .95rem; white-space: nowrap; }
.nav-links { display: flex; gap: .25rem; margin-left: auto; overflow-x: auto; scrollbar-width: none; }
.nav-links::-webkit-scrollbar { display: none; }
.nav-links a {
  display: block; padding: .4rem .7rem; border-radius: 6px;
  color: var(--muted); text-decoration: none; font-size: .9rem; white-space: nowrap;
  transition: color .15s, background-color .15s;
}
.nav-links a:hover, .nav-links a[aria-current="true"] { color: var(--text); background: var(--accent-soft); }
.nav-links a[aria-current="true"] { color: var(--accent); }
.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; flex: none;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); cursor: pointer;
  transition: border-color .15s, color .15s;
}
.icon-btn:hover { border-color: var(--accent-line); color: var(--accent); }
.icon-btn .icon { width: 18px; height: 18px; }
/* icône : on affiche celle du thème cible */
[data-theme-icon="dark"] { display: none; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) [data-theme-icon="dark"] { display: block; }
  :root:not([data-theme="dark"]) [data-theme-icon="light"] { display: none; }
}
:root[data-theme="light"] [data-theme-icon="dark"] { display: block; }
:root[data-theme="light"] [data-theme-icon="light"] { display: none; }

@media (max-width: 860px) {
  .nav-links { display: none; }
  .topbar-inner { justify-content: space-between; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding-block: clamp(3rem, 9vw, 6.5rem) clamp(3rem, 7vw, 5rem);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}
.hero::before {
  content: ""; position: absolute; inset: -30% -10% auto auto; width: 70%; aspect-ratio: 1;
  background: radial-gradient(closest-side, rgba(120, 60, 190, .28), transparent 70%);
  pointer-events: none; z-index: -1;
}
.hero-grid { display: grid; grid-template-columns: 1fr minmax(220px, 340px); gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.eyebrow { color: var(--muted); font-size: .9rem; margin-bottom: .75rem; }
.prompt { color: var(--accent); margin-right: .35em; }
.hero h1 { font-size: clamp(2.4rem, 6.5vw, 4.2rem); font-weight: 750; letter-spacing: -.03em; }
.hero-title { font-family: var(--font-mono); font-size: clamp(1rem, 2.2vw, 1.2rem); margin: .6rem 0 1.25rem; }
.hero-tagline { font-size: clamp(1.05rem, 2vw, 1.2rem); color: var(--muted); max-width: 40ch; }
.hero-meta { display: flex; align-items: center; gap: .5rem; color: var(--muted); font-size: .95rem; }
.hero-meta .icon { color: var(--accent); }
.availability {
  display: inline-flex; align-items: center; gap: .6rem; font-size: .9rem;
  padding: .35rem .8rem; border: 1px solid var(--accent-line); border-radius: 999px; background: var(--accent-soft);
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: #3ecf8e; box-shadow: 0 0 0 4px rgba(62, 207, 142, .18); }
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.75rem; }

.btn {
  display: inline-flex; align-items: center; gap: .55rem;
  padding: .7rem 1.1rem; min-height: 44px;
  font: inherit; font-size: .95rem; font-weight: 550; line-height: 1;
  color: var(--text); background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  text-decoration: none; cursor: pointer;
  transition: border-color .15s, background-color .15s, transform .15s var(--ease);
}
.btn:hover { border-color: var(--accent-line); transform: translateY(-1px); text-decoration: none; }
.btn-primary { background: var(--accent-strong); border-color: var(--accent-strong); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-strong-hover); border-color: var(--accent-strong-hover); }

.hero-photo { position: relative; margin: 0; justify-self: end; width: 100%; }
.hero-photo img {
  width: 100%; aspect-ratio: 4 / 5; object-fit: cover;
  border-radius: var(--radius); border: 1px solid var(--border);
  box-shadow: var(--shadow);
  filter: saturate(.92);
}
.corner { position: absolute; width: 28px; height: 28px; border: 2px solid var(--accent); pointer-events: none; }
.corner.tl { top: -10px; left: -10px; border-right: 0; border-bottom: 0; border-top-left-radius: 6px; }
.corner.br { bottom: -10px; right: -10px; border-left: 0; border-top: 0; border-bottom-right-radius: 6px; }

@media (max-width: 760px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-photo { order: -1; justify-self: start; max-width: 220px; }
}

/* ---------- Sections ---------- */
main section { padding-block: clamp(3.5rem, 8vw, 5.5rem); border-bottom: 1px solid var(--border); }
main section:nth-child(even) { background: color-mix(in srgb, var(--bg-2) 70%, transparent); }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.1rem); font-weight: 700; margin-bottom: 2rem; display: flex; align-items: baseline; gap: .6rem; }
h2::after { content: ""; flex: 1; height: 1px; background: var(--border); align-self: center; margin-left: .75rem; max-width: 320px; }
.sec-num { color: var(--accent); font-size: .65em; font-weight: 500; }

/* Chips */
.chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.chips li {
  font-family: var(--font-mono); font-size: .82rem; line-height: 1.3;
  padding: .35rem .65rem; border-radius: 6px;
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
}
.chips.highlight { margin-top: 1.5rem; }
.chips.highlight li { border-color: var(--accent-line); background: var(--accent-soft); color: var(--accent); }
.chips.small li { font-size: .76rem; padding: .25rem .55rem; color: var(--muted); }

/* Timeline */
.timeline { position: relative; }
.timeline::before {
  content: ""; position: absolute; top: .5rem; bottom: .5rem; left: 196px;
  width: 2px; background: linear-gradient(var(--accent-line), var(--border) 30%);
}
.tl-item { position: relative; display: grid; grid-template-columns: 176px 1fr; gap: 40px; padding-bottom: 1.5rem; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before {
  content: ""; position: absolute; left: 191px; top: 1.35rem;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--accent-line);
}
.tl-item.current::before { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 5px var(--accent-soft); }
.tl-date { font-size: .82rem; color: var(--muted); text-align: right; padding-top: 1.05rem; line-height: 1.5; }
.tl-dur { display: block; color: var(--accent); opacity: .85; }
.tl-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.1rem 1.3rem; transition: border-color .2s, transform .2s var(--ease);
}
.tl-card:hover { border-color: var(--accent-line); }
.tl-card h3 { font-size: 1.12rem; font-weight: 650; }
.tl-card .at { color: var(--accent); font-weight: 600; }
.tl-meta { color: var(--muted); font-size: .9rem; margin: .3rem 0 .8rem; }
.achievements { list-style: none; margin: 0 0 .9rem; }
.achievements li { position: relative; padding-left: 1.2rem; margin-bottom: .35rem; }
.achievements li::before { content: "›"; position: absolute; left: 0; color: var(--accent); font-weight: 700; }

@media (max-width: 700px) {
  .timeline::before { left: 5px; }
  .tl-item { grid-template-columns: 1fr; gap: .4rem; padding-left: 28px; }
  .tl-item::before { left: 0; top: .3rem; }
  .tl-date { text-align: left; padding-top: 0; }
  .tl-dur { display: inline; margin-left: .5rem; }
  .tl-dur::before { content: "· "; }
}

/* Compétences */
.skill-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; }
.skill-group { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.2rem 1.3rem; }
.skill-group h3 { font-size: .85rem; font-weight: 600; color: var(--accent); text-transform: uppercase; letter-spacing: .06em; margin-bottom: .9rem; }

/* Formation */
.edu-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem 3rem; }
@media (max-width: 760px) { .edu-grid { grid-template-columns: 1fr; } }
.edu-list { display: grid; gap: 1.1rem; }
.edu-item { display: grid; grid-template-columns: 40px 1fr; gap: 1rem; align-items: start; }
.edu-item h3 { font-size: 1.05rem; font-weight: 650; margin-bottom: .2rem; display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.edu-item p { margin: 0; font-size: .95rem; }
.edu-icon {
  display: grid; place-items: center; width: 40px; height: 40px;
  border-radius: var(--radius-sm); background: var(--accent-soft); color: var(--accent);
  border: 1px solid var(--accent-line);
}
.sub { font-size: .85rem; color: var(--accent); text-transform: uppercase; letter-spacing: .06em; margin: 0 0 1rem; }
.sub ~ .sub { margin-top: 2rem; }
.tag {
  font-family: var(--font-mono); font-size: .72rem; font-weight: 500;
  padding: .15rem .5rem; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent); border: 1px solid var(--accent-line);
}
.tag-muted { background: transparent; color: var(--muted); border-color: var(--border); }

/* Hors du code */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.3rem; transition: border-color .2s, transform .2s var(--ease);
}
.card:hover { border-color: var(--accent-line); transform: translateY(-2px); }
.card-icon { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); margin-bottom: .9rem; }
.card-icon .icon { width: 22px; height: 22px; }
.card h3 { font-size: 1.02rem; font-weight: 650; margin-bottom: .4rem; }
.card p { color: var(--muted); font-size: .95rem; margin: 0; }

/* Contact */
.contact-box {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: clamp(1.4rem, 4vw, 2rem); position: relative; overflow: hidden;
}
.contact-box::before { content: ""; position: absolute; inset: 0 0 auto; height: 3px; background: linear-gradient(90deg, var(--accent-strong), var(--accent), transparent); }
.contact-lead { font-size: 1.1rem; }
.contact-list { display: grid; gap: .6rem; }
.contact-list a, .contact-static { display: inline-flex; align-items: center; gap: .7rem; min-height: 32px; color: var(--text); text-decoration: none; word-break: break-word; }
.contact-list a:hover { color: var(--accent); }
.contact-list .icon { color: var(--accent); }

/* Footer */
.footer { padding-block: 2rem; font-size: .82rem; }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem; color: var(--muted); }

/* Apparition douce au scroll (activée par JS uniquement) */
.js .reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.js .reveal.in { opacity: 1; transform: none; }

/* Mode dev : placeholders [À COMPLÉTER] */
.todo {
  display: inline-block; margin: .3rem 0; padding: .2rem .55rem;
  font: 600 .75rem var(--font-mono); color: #3a2a00;
  background: #ffd866; border: 1px dashed #b38600; border-radius: 4px;
}

/* =========================================================
   Impression / PDF — 1 à 2 pages A4
   ========================================================= */
@page { size: A4; margin: 14mm 14mm 14mm; }
@media print {
  :root, :root[data-theme] {
    --bg: #fff; --bg-2: #fff; --surface: #fff; --surface-2: #fff;
    --border: #ddd6e6; --text: #15111b; --muted: #514a5c;
    --accent: #4f2382; --accent-strong: #4f2382; --accent-soft: #f3eef9; --accent-line: #c9b6e3;
    --grid: transparent; --shadow: none;
    color-scheme: light;
  }
  html { font-size: 9.6pt; }
  body { background: #fff; line-height: 1.45; }
  .topbar, .skip-link, .hero-actions, .corner, .footer, .todo, .hero::before, h2::after { display: none !important; }
  .js .reveal { opacity: 1 !important; transform: none !important; }
  a { color: inherit; text-decoration: none; }
  .container, .container.narrow { max-width: none; padding: 0; }
  main section, .hero { padding: 0 0 4mm; border: 0; background: none !important; }
  main section { margin-top: 2mm; }

  .hero-grid { grid-template-columns: 1fr 28mm; gap: 6mm; }
  .hero-photo { order: 0; max-width: 28mm; }
  .hero-photo img { border-radius: 4px; box-shadow: none; }
  .eyebrow { display: none; }
  .hero h1 { font-size: 22pt; }
  .hero-title { margin: 1mm 0 2mm; font-size: 11pt; }
  .hero-tagline { font-size: 10pt; max-width: none; margin-bottom: 1mm; }

  h2 { font-size: 12.5pt; margin: 0 0 2.5mm; padding-bottom: 1mm; border-bottom: 1px solid var(--accent-line); }
  .sec-num { display: none; }
  #about p { margin-bottom: 1.5mm; }
  .chips { gap: 1.2mm; }
  .chips li { font-size: 7.6pt; padding: .3mm 1.6mm; }
  .chips.highlight { margin-top: 2mm; }

  .timeline::before, .tl-item::before { display: none; }
  .tl-item { grid-template-columns: 30mm 1fr; gap: 4mm; padding-bottom: 2mm; break-inside: avoid; }
  .tl-date { padding-top: 0; font-size: 7.8pt; }
  .tl-card { padding: 0; border: 0; }
  .tl-card h3 { font-size: 10pt; }
  .tl-meta { margin: 0 0 1mm; font-size: 8.5pt; }

  .skill-grid { grid-template-columns: repeat(4, 1fr); gap: 3mm; }
  .skill-group { padding: 0; border: 0; break-inside: avoid; }
  .skill-group h3 { font-size: 7.8pt; margin-bottom: 1.5mm; }

  .edu-grid { gap: 3mm 8mm; }
  .edu-item { grid-template-columns: 1fr; break-inside: avoid; }
  .edu-icon { display: none; }
  .edu-item h3 { font-size: 10pt; }
  .edu-list { gap: 2mm; }
  .sub { margin-bottom: 2mm; font-size: 8pt; }

  .cards { grid-template-columns: repeat(4, 1fr); gap: 3mm; }
  .card { padding: 0; border: 0; break-inside: avoid; }
  .card-icon { display: none; }
  .card h3 { font-size: 9pt; margin-bottom: .5mm; }
  .card p { font-size: 8pt; }

  .contact-box { padding: 0; border: 0; }
  .contact-box::before, .contact-lead { display: none; }
  .contact-list { display: flex; flex-wrap: wrap; gap: 1mm 6mm; }
  .contact-list a, .contact-static { min-height: 0; }
  h2, h3 { break-after: avoid; }
}
