/* =========================================================
   CV en ligne — Olivier Evrard
   Palette inspirée du CV papier (beige / sable / brun)
   ========================================================= */
:root {
  --bg: #fdf8f2;
  --bg-alt: #f4e9dc;
  --sand: #e4d4c4;
  --brown: #7a5f4c;
  --brown-dark: #4e3b2e;
  --text: #3d3029;
  --muted: #7d6e64;
  --card: #ffffff;
  --shadow: 0 10px 30px rgba(78, 59, 46, .10);
  --radius: 16px;
  --font: 'Inter', system-ui, sans-serif;
  --display: 'Abril Fatface', Georgia, serif;
  --mono: 'JetBrains Mono', monospace;
}
[data-theme="dark"] {
  --bg: #1b1613;
  --bg-alt: #241d19;
  --sand: #3a2f28;
  --brown: #d2b49a;
  --brown-dark: #f0dccb;
  --text: #ede3da;
  --muted: #b2a194;
  --card: #2a221d;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  transition: background .4s, color .4s;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* Barre de progression */
.progress { position: fixed; top: 0; left: 0; height: 3px; width: 0; background: var(--brown); z-index: 200; }

/* ---------- Navigation ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 5vw;
  transition: background .3s, box-shadow .3s, padding .3s;
}
.nav.scrolled { background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); box-shadow: var(--shadow); padding: .6rem 5vw; }
.nav__logo { font-family: var(--display); font-size: 1.6rem; color: var(--brown-dark); letter-spacing: 2px; }
.nav__logo span { color: var(--brown); }
.nav__links { display: flex; gap: 1.8rem; list-style: none; }
.nav__links a { font-size: .85rem; letter-spacing: 2px; text-transform: uppercase; font-weight: 600; color: var(--muted); position: relative; }
.nav__links a::after { content: ''; position: absolute; left: 0; bottom: -4px; width: 0; height: 2px; background: var(--brown); transition: width .3s; }
.nav__links a:hover, .nav__links a.active { color: var(--brown-dark); }
.nav__links a:hover::after, .nav__links a.active::after { width: 100%; }
.nav__actions { display: flex; gap: .5rem; align-items: center; }
.icon-btn { background: none; border: 1px solid var(--sand); color: var(--brown-dark); width: 40px; height: 40px; border-radius: 50%; cursor: pointer; display: grid; place-items: center; transition: background .3s; }
.icon-btn:hover { background: var(--sand); }
.i-moon { display: none; }
[data-theme="dark"] .i-sun { display: none; }
[data-theme="dark"] .i-moon { display: block; }
.burger { display: none; flex-direction: column; gap: 4px; }
.burger span { width: 18px; height: 2px; background: currentColor; transition: .3s; }

/* ---------- Hero ---------- */
.hero {
  min-height: 100vh; position: relative; display: grid; place-items: center;
  padding: 7rem 5vw 4rem;
  background: linear-gradient(180deg, var(--bg-alt), var(--bg));
  overflow: hidden;
}
.hero__canvas { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .55; }
.hero__inner { position: relative; display: grid; grid-template-columns: 340px 1fr; gap: 4rem; align-items: center; max-width: 1150px; }
.hero__photo {
  position: relative; aspect-ratio: 4/5; border-radius: var(--radius); overflow: hidden;
  background: var(--sand); box-shadow: var(--shadow);
}
.hero__photo::before { content: ''; position: absolute; inset: 14px -14px -14px 14px; border: 2px solid var(--brown); border-radius: var(--radius); z-index: -1; }
.hero__photo img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1); transition: filter .6s, transform .6s; }
.hero__photo:hover img { filter: grayscale(0); transform: scale(1.04); }
.hero__initials { display: none; }
.hero__photo.no-photo { display: grid; place-items: center; }
.hero__photo.no-photo .hero__initials { display: block; font-family: var(--display); font-size: 6rem; color: var(--brown); }
.hero__hello { font-family: var(--mono); color: var(--brown); font-size: .95rem; }
.hero__name { font-weight: 300; font-size: clamp(2.4rem, 6vw, 4.5rem); letter-spacing: .25em; text-transform: uppercase; color: var(--brown-dark); line-height: 1.1; }
.hero__name strong { font-weight: 700; }
.hero__role { font-family: var(--display); font-weight: 400; font-size: clamp(1.3rem, 3vw, 2rem); color: var(--brown); margin: .8rem 0 1.2rem; min-height: 2.6em; letter-spacing: 1px; }
.caret { animation: blink 1s steps(1) infinite; margin-left: 2px; }
@keyframes blink { 50% { opacity: 0; } }
.hero__pitch { max-width: 620px; color: var(--muted); font-size: 1.05rem; }
.hero__pitch strong { color: var(--text); }
.hero__cta { display: flex; gap: 1rem; margin-top: 2rem; flex-wrap: wrap; }

.btn { display: inline-block; padding: .85rem 1.7rem; border-radius: 50px; font-weight: 600; font-size: .9rem; letter-spacing: 1px; cursor: pointer; border: 2px solid var(--brown); transition: transform .2s, background .3s, color .3s; font-family: var(--font); }
.btn:hover { transform: translateY(-2px); }
.btn--primary { background: var(--brown); color: var(--bg); }
.btn--primary:hover { background: var(--brown-dark); border-color: var(--brown-dark); }
.btn--ghost { background: transparent; color: var(--brown-dark); }
.btn--ghost:hover { background: var(--sand); }

.scroll-hint { position: absolute; bottom: 2rem; left: 50%; translate: -50% 0; width: 26px; height: 42px; border: 2px solid var(--brown); border-radius: 20px; }
.scroll-hint span { position: absolute; left: 50%; top: 8px; width: 4px; height: 8px; translate: -50% 0; background: var(--brown); border-radius: 2px; animation: wheel 1.6s infinite; }
@keyframes wheel { to { top: 24px; opacity: 0; } }

/* ---------- Sections ---------- */
.section { padding: 6rem 5vw; max-width: 1200px; margin: 0 auto; }
.section--alt { max-width: none; background: var(--bg-alt); }
.section--alt > * { max-width: 1200px; margin-left: auto; margin-right: auto; }
.section__title {
  font-size: .95rem; letter-spacing: .45em; text-transform: uppercase; color: var(--brown);
  margin-bottom: 3rem; display: flex; align-items: center; gap: 1rem;
}
.section__title::after { content: ''; flex: 1; height: 1px; background: var(--sand); max-width: 300px; }
.sub { margin: 3.5rem 0 1.5rem; letter-spacing: .3em; text-transform: uppercase; font-size: .85rem; color: var(--brown); }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; margin-bottom: 3rem; }
.stat { background: var(--card); border-radius: var(--radius); padding: 2rem 1.5rem; box-shadow: var(--shadow); text-align: center; }
.stat__num { font-family: var(--display); font-size: 3rem; color: var(--brown-dark); }
.stat__unit { font-weight: 600; color: var(--brown); margin-left: .3rem; }
.stat p { color: var(--muted); font-size: .9rem; }

/* Atouts */
.atouts { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1rem; }
.atout { padding: 1.5rem 1.2rem; border-radius: var(--radius); border: 1px solid var(--sand); transition: transform .3s, background .3s, box-shadow .3s; }
.atout:hover { transform: translateY(-6px); background: var(--card); box-shadow: var(--shadow); }
.atout__ico { font-size: 1.8rem; }
.atout h4 { margin: .6rem 0 .3rem; font-size: .98rem; color: var(--brown-dark); }
.atout p { font-size: .85rem; color: var(--muted); }

/* Timeline */
.timeline { position: relative; padding-left: 2.5rem; }
.timeline::before { content: ''; position: absolute; left: 9px; top: 0; bottom: 0; width: 2px; background: var(--sand); }
.timeline::after { content: ''; position: absolute; left: 9px; top: 0; width: 2px; height: var(--tl-progress, 0%); background: var(--brown); transition: height .1s linear; }
.tl-item { position: relative; margin-bottom: 2.5rem; }
.tl-dot { position: absolute; left: -2.5rem; top: 1.6rem; width: 20px; height: 20px; border-radius: 50%; background: var(--bg-alt); border: 3px solid var(--brown); z-index: 1; }
.tl-card { background: var(--card); padding: 1.8rem 2rem; border-radius: var(--radius); box-shadow: var(--shadow); transition: transform .3s; }
.tl-card:hover { transform: translateX(6px); }
.tl-date { font-family: var(--mono); font-size: .8rem; color: var(--brown); font-style: italic; }
.tl-card h4 { font-size: 1.15rem; margin: .3rem 0; color: var(--brown-dark); }
.tl-org { color: var(--muted); font-size: .9rem; margin-bottom: .8rem; }
.tl-card ul { padding-left: 1.2rem; }
.tl-card li { margin-bottom: .3rem; }
.tags { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }
.tags span { font-size: .75rem; padding: .25rem .75rem; border-radius: 50px; background: var(--sand); color: var(--brown-dark); font-weight: 600; }

/* Certification */
.cert { display: flex; align-items: center; gap: 1.5rem; padding: 1.5rem 2rem; border-radius: var(--radius); background: linear-gradient(120deg, var(--brown), var(--brown-dark)); color: var(--bg); margin-bottom: 2.5rem; box-shadow: var(--shadow); }
.cert__badge { width: 90px; height: 90px; border-radius: 50%; border: 2px dashed var(--bg); display: grid; place-items: center; text-align: center; font-size: .75rem; line-height: 1.2; animation: spin 18s linear infinite; flex-shrink: 0; }
.cert__badge strong { font-size: 1.1rem; }
@keyframes spin { to { rotate: 360deg; } }
.cert h4 { font-size: 1.3rem; }

/* Cartes formations */
.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; }
.card { background: var(--card); padding: 1.6rem; border-radius: var(--radius); box-shadow: var(--shadow); display: flex; flex-direction: column; transition: transform .3s; transform-style: preserve-3d; }
.card__head { display: flex; justify-content: space-between; align-items: center; }
.card__ico { font-size: 2rem; }
.card__year { font-family: var(--mono); font-size: .8rem; color: var(--brown); }
.card h4 { margin-top: .8rem; color: var(--brown-dark); font-size: 1.1rem; }
.card__org { font-weight: 600; color: var(--brown); font-size: .85rem; margin-bottom: .6rem; }
.card p { font-size: .88rem; }
.card__proj { color: var(--muted); margin-top: .6rem; flex: 1; }
.bar { height: 6px; background: var(--sand); border-radius: 3px; margin-top: 1.2rem; overflow: hidden; }
.bar span { display: block; height: 100%; width: 0; background: var(--brown); border-radius: 3px; transition: width 1.4s cubic-bezier(.2, .8, .2, 1); }
.bar__label { font-family: var(--mono); font-size: .75rem !important; color: var(--muted); margin-top: .3rem; text-align: right; }

.initial { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.initial__item { display: flex; gap: 1.2rem; align-items: center; padding: 1.2rem 1.5rem; border-left: 3px solid var(--brown); background: var(--bg-alt); border-radius: 0 var(--radius) var(--radius) 0; }
.initial__item span { font-family: var(--display); font-size: 1.8rem; color: var(--brown); }

/* Compétences */
.filters { display: flex; flex-wrap: wrap; gap: .6rem; margin-bottom: 2rem; }
.filter { font-family: var(--font); background: transparent; border: 1px solid var(--brown); color: var(--brown-dark); padding: .5rem 1.1rem; border-radius: 50px; cursor: pointer; font-weight: 600; font-size: .85rem; transition: .3s; }
.filter:hover, .filter.active { background: var(--brown); color: var(--bg); }
.skills { display: flex; flex-wrap: wrap; gap: .8rem; min-height: 120px; }
.skill { background: var(--card); padding: .7rem 1.3rem; border-radius: 12px; box-shadow: var(--shadow); font-weight: 600; color: var(--brown-dark); transition: opacity .35s, transform .35s; }
.skill[data-cat="data"] { border-bottom: 3px solid #b08968; }
.skill[data-cat="auto"] { border-bottom: 3px solid #8c9a6e; }
.skill[data-cat="dev"]  { border-bottom: 3px solid #6f8aa3; }
.skill[data-cat="cyber"]{ border-bottom: 3px solid #a2615a; }
.skill.hide { opacity: 0; transform: scale(.7); position: absolute; pointer-events: none; }

/* Terminal */
.terminal { margin-top: 3rem; border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); background: #1e1a17; max-width: 760px; }
.terminal__bar { display: flex; align-items: center; gap: 6px; padding: .6rem 1rem; background: #2d2622; }
.terminal__bar i { width: 12px; height: 12px; border-radius: 50%; background: #ff5f57; }
.terminal__bar i:nth-child(2) { background: #febc2e; }
.terminal__bar i:nth-child(3) { background: #28c840; }
.terminal__bar span { margin-left: auto; font-family: var(--mono); color: #a89585; font-size: .8rem; }
.terminal__body { font-family: var(--mono); color: #e8d9c8; padding: 1.2rem 1.4rem; font-size: .88rem; min-height: 230px; white-space: pre-wrap; }
.terminal__body .p { color: #d2b49a; }
.terminal__body .ok { color: #28c840; }

/* Projets */
.projects { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
.project { position: relative; background: var(--card); padding: 2rem; border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; transition: transform .3s; }
.project::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--brown); transform: scaleY(0); transform-origin: top; transition: transform .4s; }
.project:hover { transform: translateY(-6px); }
.project:hover::before { transform: scaleY(1); }
.project__ico { font-size: 2.2rem; margin-bottom: .6rem; }
.project h4 { color: var(--brown-dark); font-size: 1.15rem; margin-bottom: .4rem; }
.project p { color: var(--muted); }

/* Hobbies */
.hobbies { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.hobby { text-align: center; padding: 2rem 1.5rem; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); }
.hobby span { font-size: 2.6rem; display: inline-block; transition: transform .4s; }
.hobby:hover span { transform: scale(1.25) rotate(-8deg); }
.hobby h4 { margin: .6rem 0 .3rem; color: var(--brown-dark); }
.hobby p { color: var(--muted); font-size: .9rem; }

/* Contact */
.contact { text-align: center; }
.contact .section__title { justify-content: center; }
.contact .section__title::before { content: ''; flex: 1; height: 1px; background: var(--sand); max-width: 300px; }
.contact__intro { font-family: var(--display); font-size: 1.6rem; color: var(--brown-dark); margin-bottom: 2.5rem; }
.contact__grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 2.5rem; }
.contact__item { display: flex; flex-direction: column; align-items: center; gap: .7rem; padding: 1.6rem 1rem; border-radius: var(--radius); border: 1px solid var(--sand); transition: .3s; color: var(--brown-dark); font-size: .92rem; word-break: break-word; }
.contact__item svg { width: 30px; height: 30px; color: var(--brown); }
a.contact__item:hover { background: var(--brown); color: var(--bg); border-color: var(--brown); }
a.contact__item:hover svg { color: var(--bg); }

.footer { text-align: center; padding: 2rem; color: var(--muted); font-size: .85rem; border-top: 1px solid var(--sand); }

.to-top { position: fixed; right: 1.5rem; bottom: 1.5rem; width: 46px; height: 46px; border-radius: 50%; border: none; background: var(--brown); color: var(--bg); font-size: 1.2rem; cursor: pointer; opacity: 0; pointer-events: none; transition: .3s; box-shadow: var(--shadow); z-index: 90; }
.to-top.show { opacity: 1; pointer-events: auto; }
.toast { position: fixed; left: 50%; bottom: 2rem; translate: -50% 150%; background: var(--brown-dark); color: var(--bg); padding: .8rem 1.5rem; border-radius: 50px; transition: translate .4s; z-index: 300; }
.toast.show { translate: -50% 0; }

/* Révélation au scroll */
.reveal { opacity: 0; transform: translateY(30px); transition: opacity .8s ease, transform .8s ease; }
.reveal.visible { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1050px) {
  .atouts { grid-template-columns: repeat(3, 1fr); }
  .cards { grid-template-columns: repeat(2, 1fr); }
  .contact__grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 860px) {
  .burger { display: flex; }
  .nav__links { position: fixed; top: 0; right: 0; height: 100vh; width: 70%; max-width: 300px; flex-direction: column; justify-content: center; padding: 2rem; background: var(--bg); box-shadow: var(--shadow); transform: translateX(100%); transition: transform .4s; }
  .nav__links.open { transform: none; }
  .hero__inner { grid-template-columns: 1fr; gap: 2.5rem; text-align: center; }
  .hero__photo { width: 220px; margin: 0 auto; }
  .hero__pitch { margin: 0 auto; }
  .hero__cta { justify-content: center; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .projects, .initial { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .atouts, .cards, .hobbies, .contact__grid { grid-template-columns: 1fr; }
  .hero__name { letter-spacing: .12em; }
  .cert { flex-direction: column; text-align: center; }
  .section { padding: 4.5rem 6vw; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}

@media print {
  .nav, .hero__canvas, .scroll-hint, .to-top, .toast, .terminal, .filters, .hero__cta, #copyMail { display: none !important; }
  .reveal { opacity: 1 !important; transform: none !important; }
  .hero { min-height: auto; padding: 1rem; }
  .section { padding: 1.5rem 1rem; }
}
