/* ===== Thème ===== */
:root {
  --bg: #0b1016;
  --bg-2: #111821;
  --card: #141d28;
  --line: #223042;
  --text: #e6edf3;
  --muted: #8b9bb0;
  --accent: #3ddc97;
  --accent-2: #4cc9f0;
  --radius: 14px;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

.container { width: min(1120px, 100% - 40px); margin-inline: auto; }
.accent { color: var(--accent); }

/* ===== Navigation ===== */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(11, 16, 22, .85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav__inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.nav__logo { font-family: var(--mono); font-weight: 600; font-size: 1rem; }
.prompt { color: var(--accent); }
.nav__links { display: flex; gap: 28px; align-items: center; font-size: .95rem; }
.nav__links a { color: var(--muted); transition: color .2s; }
.nav__links a:hover { color: var(--text); }
.nav__links .nav__cta { color: var(--bg); background: var(--accent); padding: 8px 16px; border-radius: 8px; font-weight: 600; }
.nav__links .nav__cta:hover { color: var(--bg); filter: brightness(1.1); }
.lang { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; font-family: var(--mono); font-size: .8rem; }
.lang b, .nav__links .lang a { padding: 6px 10px; }
.lang b { background: var(--line); color: var(--text); font-weight: 600; }
.nav__toggle { display: none; background: none; border: 0; cursor: pointer; padding: 8px; }
.nav__toggle span { display: block; width: 22px; height: 2px; background: var(--text); margin: 5px 0; transition: .3s; }

/* ===== Boutons ===== */
.btn {
  display: inline-block; padding: 12px 22px; border-radius: 10px;
  font-weight: 600; font-size: .95rem; transition: transform .15s, filter .2s, border-color .2s;
}
.btn:hover { transform: translateY(-2px); }
.btn--primary { background: var(--accent); color: var(--bg); }
.btn--primary:hover { filter: brightness(1.1); }
.btn--ghost { border: 1px solid var(--line); color: var(--text); }
.btn--ghost:hover { border-color: var(--accent); }
.btn--big { font-size: 1.05rem; padding: 16px 28px; word-break: break-all; }

/* ===== Accueil ===== */
.hero { padding: 90px 0 60px; position: relative; isolation: isolate; }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(600px 300px at 80% 20%, rgba(61, 220, 151, .08), transparent 70%),
    linear-gradient(var(--line) 1px, transparent 1px) 0 0 / 40px 40px,
    linear-gradient(90deg, var(--line) 1px, transparent 1px) 0 0 / 40px 40px;
  background-color: var(--bg);
  -webkit-mask-image: linear-gradient(#000 75%, transparent);
          mask-image: linear-gradient(#000 75%, transparent);
}
.hero__inner { display: grid; grid-template-columns: 1.3fr 1fr; gap: 60px; align-items: center; }
.eyebrow { display: inline-flex; align-items: center; gap: 10px; font-family: var(--mono); font-size: .8rem; color: var(--accent); border: 1px solid rgba(61,220,151,.3); padding: 6px 12px; border-radius: 99px; margin-bottom: 24px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent); animation: pulse 2s infinite; }
@keyframes pulse { 50% { opacity: .4; } }
h1 { font-size: clamp(2.4rem, 5.5vw, 4rem); line-height: 1.1; letter-spacing: -.02em; }
.hero__role { font-family: var(--mono); color: var(--accent-2); font-size: 1.1rem; margin: 14px 0 18px; }
.hero__lead { color: var(--muted); max-width: 54ch; font-size: 1.08rem; }
.hero__actions { display: flex; gap: 14px; margin-top: 32px; flex-wrap: wrap; }

.hero__card { position: relative; }
.hero__photo {
  width: 220px; height: 270px; object-fit: cover; object-position: top;
  border-radius: var(--radius); border: 1px solid var(--line);
  margin-left: auto; filter: saturate(.9);
}
.terminal {
  background: #070b10; border: 1px solid var(--line); border-radius: 12px;
  font-family: var(--mono); font-size: .82rem; overflow: hidden;
  margin-top: -70px; margin-right: 120px; position: relative;
  box-shadow: 0 20px 50px rgba(0,0,0,.5);
}
.terminal__bar { display: flex; align-items: center; gap: 6px; padding: 9px 12px; background: var(--bg-2); border-bottom: 1px solid var(--line); }
.terminal__bar i { width: 10px; height: 10px; border-radius: 50%; background: #3a4656; }
.terminal__bar i:first-child { background: #ff5f57; }
.terminal__bar i:nth-child(2) { background: #febc2e; }
.terminal__bar i:nth-child(3) { background: #28c840; }
.terminal__bar span { margin-left: auto; color: var(--muted); font-size: .72rem; }
.terminal pre { padding: 14px 16px; color: #c9d4e0; white-space: pre-wrap; }
.t-p { color: var(--accent); }
.cursor { color: var(--accent); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* ===== Chiffres ===== */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.stat { background: var(--bg-2); padding: 26px 22px; }
.stat strong { display: block; font-size: 2rem; font-family: var(--mono); color: var(--accent); line-height: 1.2; }
.stat span { color: var(--muted); font-size: .9rem; }

/* ===== Sections ===== */
.section { padding: 100px 0 20px; }
.section__tag { font-family: var(--mono); color: var(--accent); font-size: .85rem; margin-bottom: 10px; }
h2 { font-size: clamp(1.7rem, 3.5vw, 2.4rem); line-height: 1.2; letter-spacing: -.01em; margin-bottom: 32px; max-width: 24ch; }
.section__intro { color: var(--muted); margin: -18px 0 30px; }
.subhead { font-family: var(--mono); font-size: .85rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 40px 0 18px; font-weight: 600; }
.subhead:first-of-type { margin-top: 0; }

/* À propos */
.about { display: grid; grid-template-columns: 1fr 1fr; gap: 24px 48px; color: #c3cfdc; }
.about strong { color: var(--text); }
.about__langs { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.about__langs li { border: 1px solid var(--line); border-radius: 99px; padding: 6px 14px; font-size: .88rem; color: var(--muted); }
.about__langs span { color: var(--text); font-weight: 600; margin-right: 6px; }

/* Compétences */
.skills { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.skill { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; transition: border-color .2s, transform .2s; }
.skill:hover { border-color: rgba(61,220,151,.45); transform: translateY(-3px); }
.skill h3 { font-size: 1.05rem; margin-bottom: 16px; display: flex; align-items: center; gap: 10px; }
.skill__icon { font-family: var(--mono); color: var(--accent); width: 34px; height: 34px; display: grid; place-items: center; background: rgba(61,220,151,.1); border-radius: 8px; font-size: .9rem; }
.skill ul, .tags { display: flex; flex-wrap: wrap; gap: 8px; }
.skill li, .tags li { font-size: .82rem; background: var(--bg-2); border: 1px solid var(--line); color: #b8c5d4; padding: 4px 10px; border-radius: 6px; }

/* Projets */
.projects { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.projects--small { grid-template-columns: repeat(2, 1fr); }
.project {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column; transition: border-color .2s, transform .2s;
}
.project[data-gallery] { cursor: pointer; }
.project:hover { border-color: rgba(61,220,151,.45); transform: translateY(-4px); }
.project__img { aspect-ratio: 16 / 9; background: #f4f6f8; overflow: hidden; position: relative; }
.project__img img { width: 100%; height: 100%; object-fit: cover; object-position: top; transition: transform .4s; }
.project:hover .project__img img { transform: scale(1.04); }
.project[data-gallery] .project__img::after {
  content: attr(data-label); position: absolute; right: 10px; bottom: 10px;
  font-family: var(--mono); font-size: .72rem; background: rgba(7,11,16,.85); color: var(--text);
  padding: 4px 8px; border-radius: 6px;
}
.project__body { padding: 22px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.project__meta { font-family: var(--mono); font-size: .76rem; color: var(--accent-2); }
.project h4 { font-size: 1.08rem; line-height: 1.35; }
.project p { color: var(--muted); font-size: .93rem; }
.project .tags { margin-top: auto; padding-top: 6px; }
.project--featured { grid-column: 1 / -1; flex-direction: row; }
.project--featured .project__img { flex: 1.2; aspect-ratio: auto; min-height: 260px; }
.project--featured .project__body { flex: 1; }
.link { color: var(--accent); font-weight: 600; font-size: .95rem; margin-top: 4px; }
.link:hover { text-decoration: underline; }

/* Avis clients */
.rating { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 24px; margin-bottom: 20px; }
.rating__score { display: flex; align-items: baseline; gap: 12px; }
.rating__score strong { font-family: var(--mono); font-size: 2.4rem; color: var(--accent); line-height: 1; }
.stars { color: #fbbf24; font-size: 1.2rem; letter-spacing: 2px; }
.rating p { color: var(--muted); font-size: .95rem; }
.rating b { color: var(--text); }
/* Défilement continu des avis (les cartes sont doublées par script.js pour boucler sans coupure) */
.reviews {
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}
.reviews__track { display: flex; width: max-content; animation: defile var(--duree, 60s) linear infinite; }
.reviews:hover .reviews__track, .reviews.paused .reviews__track { animation-play-state: paused; }
.reviews__track > .review { width: 360px; margin-right: 18px; flex-shrink: 0; }
@keyframes defile { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.review { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; display: flex; flex-direction: column; gap: 12px; position: relative; }
.review::before { content: "“"; position: absolute; top: 6px; right: 18px; font-size: 4rem; line-height: 1; color: rgba(61,220,151,.18); font-family: Georgia, serif; }
.review blockquote { font-size: .98rem; color: #d3dde8; }
.review__orig { font-size: .85rem; color: var(--muted); border-right: 2px solid var(--line); padding-right: 10px; }
.review figcaption { margin-top: auto; font-size: .85rem; color: var(--muted); }
.review figcaption b { color: var(--text); }
.reviews__more { margin-top: 18px; color: var(--muted); font-size: .88rem; }

/* Parcours */
.timeline-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 56px; }
.timeline { border-left: 2px solid var(--line); padding-left: 26px; display: grid; gap: 30px; }
.timeline > li { position: relative; }
.timeline > li::before {
  content: ""; position: absolute; left: -33px; top: 6px; width: 12px; height: 12px;
  border-radius: 50%; background: var(--bg); border: 2px solid var(--accent);
}
.timeline > li:first-child::before { background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.timeline__date { font-family: var(--mono); font-size: .8rem; color: var(--accent-2); }
.timeline h4 { font-size: 1.05rem; margin: 4px 0 8px; }
.timeline p, .timeline ul { color: var(--muted); font-size: .93rem; }
.timeline ul li { padding-left: 16px; position: relative; margin-bottom: 4px; }
.timeline ul li::before { content: "›"; position: absolute; left: 0; color: var(--accent); }
.certs { display: grid; gap: 12px; }
.certs li { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; font-size: .92rem; color: #c3cfdc; display: flex; gap: 12px; align-items: center; }
.cert__badge { font-family: var(--mono); font-size: .72rem; font-weight: 600; background: rgba(76,201,240,.12); color: var(--accent-2); padding: 4px 8px; border-radius: 6px; flex-shrink: 0; }

/* Contact */
.contact {
  text-align: center; background: var(--card); border: 1px solid var(--line); border-radius: 20px;
  padding: 64px 28px; margin-bottom: 80px;
  background-image: radial-gradient(500px 200px at 50% 0%, rgba(61,220,151,.1), transparent 70%);
}
.contact h2 { margin: 0 auto 14px; }
.contact > p:not(.section__tag) { color: var(--muted); margin-bottom: 30px; }
.contact__links { display: flex; justify-content: center; gap: 28px; margin-top: 28px; flex-wrap: wrap; }
.contact__links a { color: var(--muted); font-weight: 500; }
.contact__links a:hover { color: var(--accent); }

.footer { border-top: 1px solid var(--line); padding: 28px 0; color: var(--muted); font-size: .85rem; text-align: center; font-family: var(--mono); }

/* Galerie */
.lightbox {
  position: fixed; inset: 0; z-index: 100; background: rgba(4, 7, 10, .94);
  display: flex; align-items: center; justify-content: center; padding: 60px 70px;
}
.lightbox[hidden] { display: none; }
.lightbox__img { max-width: 100%; max-height: 100%; border-radius: 10px; background: #fff; box-shadow: 0 20px 60px rgba(0,0,0,.6); }
.lightbox button { position: absolute; background: var(--card); border: 1px solid var(--line); color: var(--text); width: 46px; height: 46px; border-radius: 50%; font-size: 1.6rem; cursor: pointer; line-height: 1; }
.lightbox button:hover { border-color: var(--accent); color: var(--accent); }
.lightbox__close { top: 16px; right: 16px; }
.lightbox__prev { left: 14px; top: 50%; transform: translateY(-50%); }
.lightbox__next { right: 14px; top: 50%; transform: translateY(-50%); }
.lightbox__count { position: absolute; bottom: 18px; font-family: var(--mono); color: var(--muted); font-size: .85rem; }

/* Apparition au défilement */
.reveal { opacity: 0; transform: translateY(20px); transition: opacity .6s, transform .6s; }
.reveal.visible { opacity: 1; transform: none; }

/* ===== Responsive ===== */
@media (max-width: 960px) {
  .hero__inner { grid-template-columns: 1fr; gap: 40px; }
  .hero__card { max-width: 420px; }
  .hero__photo { margin-left: 0; }
  .terminal { margin: -60px 0 0 90px; }
  .skills, .projects { grid-template-columns: repeat(2, 1fr); }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .timeline-grid { grid-template-columns: 1fr; gap: 20px; }
}
@media (max-width: 720px) {
  body { font-size: 16px; }
  .nav__toggle { display: block; }
  .nav__links {
    position: absolute; top: 64px; left: 0; right: 0; flex-direction: column; gap: 0;
    background: var(--bg-2); border-bottom: 1px solid var(--line);
    max-height: 0; overflow: hidden; transition: max-height .3s;
  }
  .nav__links.open { max-height: 400px; }
  .nav__links a { padding: 14px 20px; width: 100%; }
  .nav__links .nav__cta { border-radius: 0; }
  .lang { margin: 12px 20px; }
  .nav__links .lang a { width: auto; padding: 6px 12px; }
  .nav.menu-open .nav__toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav.menu-open .nav__toggle span:nth-child(2) { opacity: 0; }
  .nav.menu-open .nav__toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  .hero { padding-top: 56px; }
  .hero__photo { width: 170px; height: 210px; }
  .terminal { margin: -50px 0 0 50px; }
  .about, .skills, .projects, .projects--small { grid-template-columns: 1fr; }
  .reviews__track > .review { width: 280px; margin-right: 14px; }
  .project--featured { grid-column: auto; flex-direction: column; }
  .project--featured .project__img { aspect-ratio: 16 / 9; min-height: 0; flex: none; }
  .section { padding-top: 72px; }
  .stat { padding: 20px 16px; }
  .stat strong { font-size: 1.6rem; }
  .lightbox { padding: 60px 12px; }
  .lightbox__prev, .lightbox__next { top: auto; bottom: 12px; transform: none; }
  .lightbox__prev { left: 20px; } .lightbox__next { right: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  .reviews { overflow-x: auto; }
  .reveal { opacity: 1; transform: none; }
}
