/* ===== Jetons ===== */
:root {
  --blue: #0A3CFF;        /* bleu électrique */
  --blue-deep: #0626B8;
  --blue-light: #4D75FF;
  --ink: #12151C;
  --grey-900: #1E222B;
  --grey-700: #4A505C;
  --grey-500: #868C98;
  --grey-300: #C9CDD4;
  --grey-100: #E8EAEE;
  --grey-50: #F3F4F6;
  --white: #fff;
  --shadow: 10px 10px 0 var(--blue);
  --pad: clamp(1.25rem, 5vw, 5rem);
  --font-display: "Archivo", "Arial Black", Impact, sans-serif;
  --font-body: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 5rem; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--grey-100);
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.05; margin: 0; letter-spacing: -0.02em; }
p { margin: 0; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }

.skip { position: absolute; left: -999px; top: 0; background: var(--blue); color: #fff; padding: .75rem 1rem; z-index: 100; }
.skip:focus { left: 0; }

/* ===== En-tête ===== */
.site-header {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: .9rem var(--pad);
  background: var(--grey-100);
  border-bottom: 3px solid var(--ink);
}
.logo { display: flex; align-items: center; gap: .6rem; font-family: var(--font-display); font-weight: 900; font-size: 1.4rem; text-decoration: none; }
.logo-cube { width: 1.4rem; height: 1.4rem; background: var(--blue); box-shadow: 4px 4px 0 var(--ink); }
.nav { display: flex; gap: .5rem; align-items: center; }
.nav a { text-decoration: none; font-weight: 500; padding: .45rem .9rem; }
.nav a:hover { background: var(--grey-300); }
.nav .nav-cta { background: var(--blue); color: #fff; }
.nav .nav-cta:hover { background: var(--blue-deep); }
.menu-btn {
  display: none; font: inherit; font-weight: 700; cursor: pointer;
  background: var(--ink); color: #fff; border: 0; padding: .5rem 1rem;
}

/* ===== Boutons ===== */
.btn {
  display: inline-block; font: inherit; font-weight: 700; text-decoration: none; cursor: pointer;
  padding: .95rem 1.6rem; border: 3px solid var(--ink);
  transition: transform .15s, box-shadow .15s;
}
.btn-primary { background: var(--blue); color: #fff; box-shadow: 5px 5px 0 var(--ink); }
.btn-ghost { background: var(--white); color: var(--ink); box-shadow: 5px 5px 0 var(--ink); }
.btn:hover { transform: translate(-2px, -2px); box-shadow: 7px 7px 0 var(--ink); }
.btn:active { transform: translate(3px, 3px); box-shadow: 2px 2px 0 var(--ink); }

/* ===== Hero pleine largeur ===== */
.hero {
  --mx: 0; --my: 0;
  position: relative; isolation: isolate; overflow: hidden;
  min-height: max(760px, calc(100svh - 4.5rem));
  padding: clamp(2.5rem, 9vh, 6rem) var(--pad) 0;
  background: linear-gradient(180deg, var(--blue) 0 78%, #2C6440 78%);   /* repli sans JavaScript */
  color: #fff;
}
.hero :focus-visible { outline-color: #fff; }

.scene { position: absolute; inset: 0; width: 100%; height: 100%; display: block; pointer-events: none; }
.scene-back { z-index: 0; }
.scene-front { z-index: 3; }
.par {
  transform: translate(calc(var(--mx) * var(--d) * -22px), calc(var(--my) * var(--d) * -8px));
  will-change: transform;
}
.sway { animation: sway 6s ease-in-out infinite alternate; }
.cloud { animation: drift var(--t, 120s) linear infinite; animation-delay: var(--dl, 0s); }
@keyframes sway { from { transform: rotate(-.6deg); } to { transform: rotate(.6deg); } }
@keyframes drift { from { transform: translateX(var(--from)); } to { transform: translateX(var(--to)); } }

.hero-text { position: relative; z-index: 4; max-width: min(46%, 36rem); }
.hero-kicker {
  display: inline-block; margin-bottom: 1.3rem; padding: .3rem .8rem;
  background: var(--ink); color: #fff; font-weight: 700;
}
.hero h1 {
  font-size: clamp(2.6rem, 6vw, 5.4rem); font-weight: 900; font-stretch: 110%;
  max-width: 12ch; color: #fff; text-shadow: 4px 4px 0 var(--blue-deep);
}
.hero-lead { margin-top: 1.6rem; max-width: 42ch; color: #fff; font-size: 1.15rem; font-weight: 500; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 1.2rem; margin-top: 2.2rem; }
.hero .btn-primary { background: #fff; color: var(--ink); }
.hero .btn-ghost { background: var(--ink); color: #fff; }

/* Portrait */
.portrait {
  position: absolute; z-index: 2; margin: 0;
  right: clamp(1.5rem, 9vw, 10rem);
  bottom: calc(14% + 40px);
  height: min(66%, 640px); aspect-ratio: 4 / 5;
}
.portrait-float { width: 100%; height: 100%; animation: bob 6s ease-in-out infinite; }
.portrait-tilt {
  width: 100%; height: 100%;
  transform: perspective(1100px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  will-change: transform;
}
.portrait-frame {
  position: relative; width: 100%; height: 100%;
  border: 4px solid var(--ink); background: var(--blue-deep);
  box-shadow: 14px 14px 0 var(--ink);
}
.portrait-frame::before, .portrait-frame::after {
  content: ""; position: absolute; z-index: 2; border: 3px solid var(--ink);
}
.portrait-frame::before { left: -22px; top: -22px; width: 38px; height: 38px; background: var(--blue-light); }
.portrait-frame::after  { left: -16px; bottom: -16px; width: 26px; height: 26px; background: var(--grey-300); }
.portrait-clip { position: relative; width: 100%; height: 100%; overflow: hidden; }
.portrait-clip img {
  display: block; width: 100%; height: 100%; object-fit: cover;
  animation: push 14s ease-in-out infinite alternate;
}
.portrait-shadow {
  position: absolute; left: 8%; right: 8%; top: calc(100% + 32px); height: 16px;
  background: rgba(18, 21, 28, .4);
  animation: shade 6s ease-in-out infinite;
}
@keyframes bob  { 0%, 100% { transform: translateY(0) rotate(-.4deg); } 50% { transform: translateY(-12px) rotate(.5deg); } }
@keyframes push { from { transform: scale(1); } to { transform: scale(1.07); } }
@keyframes shade { 0%, 100% { transform: scaleX(1); opacity: 1; } 50% { transform: scaleX(.86); opacity: .6; } }

/* Révélation par cubes */
.js .tiles { background: var(--blue); }
.tiles {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  display: grid; grid-template-columns: repeat(8, 1fr); grid-template-rows: repeat(10, 1fr);
}
.tiles i {
  background: var(--c, var(--blue));
  animation: tile .5s cubic-bezier(.6, 0, .2, 1) both paused;
  animation-delay: var(--dl, 0ms);
}
.tiles.go i { animation-play-state: running; }
@keyframes tile { from { transform: scale(1.03); } to { transform: scale(0); } }

@media (max-width: 980px) {
  .hero {
    display: flex; flex-direction: column; align-items: center;
    min-height: 0; padding: 2.25rem var(--pad) 3rem;
    background: linear-gradient(180deg, var(--blue) 0 50%, #2C6440 50%);
  }
  .portrait {
    position: relative; right: auto; bottom: auto; order: -1;
    height: auto; width: min(62vw, 300px); margin: 0 auto;
  }
  .portrait-frame { box-shadow: 10px 10px 0 var(--ink); }
  .portrait-shadow { top: calc(100% + 14px); }
  .hero-text {
    max-width: none; width: 100%; margin-top: 3.5rem; padding: 1.5rem;
    background: #fff; color: var(--ink); border: 3px solid var(--ink); box-shadow: 8px 8px 0 var(--ink);
  }
  .hero-text :focus-visible { outline-color: var(--blue); }
  .hero-kicker { background: var(--blue); }
  .hero h1 { color: var(--ink); text-shadow: none; font-size: clamp(2.2rem, 9vw, 3.4rem); }
  .hero-lead { color: var(--grey-700); font-weight: 400; }
  .hero .btn-primary { background: var(--blue); color: #fff; }
  .hero .btn-ghost { background: #fff; color: var(--ink); }
}

/* ===== Chiffres ===== */
.facts {
  display: grid; grid-template-columns: repeat(3, 1fr);
  background: var(--blue); color: #fff;
  border-block: 3px solid var(--ink);
}
.facts div { padding: 2rem var(--pad); border-right: 3px solid var(--ink); display: flex; flex-direction: column; gap: .2rem; }
.facts div:last-child { border-right: 0; }
.facts strong { font-family: var(--font-display); font-size: clamp(2rem, 4vw, 3.2rem); font-weight: 900; line-height: 1; }
.facts span { opacity: .85; }

/* ===== Sections ===== */
.section { padding: clamp(4rem, 9vw, 7rem) var(--pad); }
.section-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 1rem 3rem; margin-bottom: 3rem; }
.section-head h2 { font-size: clamp(2.2rem, 5vw, 4rem); font-weight: 900; font-stretch: 105%; }
.section-head p { color: var(--grey-700); max-width: 40ch; }

/* Projets */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2.5rem; }
.card {
  background: var(--white); border: 3px solid var(--ink);
  box-shadow: var(--shadow);
  transition: transform .2s, box-shadow .2s;
  display: flex; flex-direction: column;
}
.card:hover { transform: translate(-4px, -4px); box-shadow: 14px 14px 0 var(--blue); }
.cover {
  aspect-ratio: 4 / 3; display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(2, 1fr);
  gap: 0; border-bottom: 3px solid var(--ink); background: var(--grey-100);
}
.cover i { display: block; border: 1.5px solid rgba(18,21,28,.25); transition: background .25s; }
/* motifs de cubes : chaque carte a sa composition */
.c1 .cover i:nth-child(1), .c1 .cover i:nth-child(5) { background: var(--blue); }
.c1 .cover i:nth-child(3) { background: var(--grey-900); }
.c1 .cover i:nth-child(4) { background: var(--grey-300); }

.c2 .cover i:nth-child(2), .c2 .cover i:nth-child(6) { background: var(--blue); }
.c2 .cover i:nth-child(1) { background: var(--grey-700); }
.c2 .cover i:nth-child(4) { background: var(--grey-300); }

.c3 .cover i:nth-child(3), .c3 .cover i:nth-child(4) { background: var(--blue); }
.c3 .cover i:nth-child(2) { background: var(--grey-900); }
.c3 .cover i:nth-child(6) { background: var(--grey-500); }

.c4 .cover i:nth-child(1), .c4 .cover i:nth-child(2) { background: var(--blue-light); }
.c4 .cover i:nth-child(5) { background: var(--blue); }
.c4 .cover i:nth-child(6) { background: var(--grey-900); }

.c5 .cover i:nth-child(2), .c5 .cover i:nth-child(4) { background: var(--grey-900); }
.c5 .cover i:nth-child(5) { background: var(--blue); }
.c5 .cover i:nth-child(3) { background: var(--grey-300); }

.c6 .cover i:nth-child(1), .c6 .cover i:nth-child(6) { background: var(--blue); }
.c6 .cover i:nth-child(3) { background: var(--grey-500); }
.c6 .cover i:nth-child(5) { background: var(--grey-700); }

.card:hover .cover i:nth-child(odd):not([style]) { filter: brightness(1.12); }

.card-body { padding: 1.5rem; display: flex; flex-direction: column; gap: .6rem; flex: 1; }
.card-body h3 { font-size: 1.6rem; font-weight: 800; }
.card-body p { color: var(--grey-700); }
.tags { list-style: none; display: flex; flex-wrap: wrap; gap: .5rem; padding: 0; margin: auto 0 0; padding-top: .8rem; }
.tags li { font-size: .85rem; font-weight: 700; padding: .2rem .7rem; background: var(--grey-100); border: 2px solid var(--ink); }

/* Compétences */
.dark { background: var(--grey-900); color: #fff; border-block: 3px solid var(--ink); }
.dark .section-head p { color: var(--grey-300); }
.skills { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; }
.skill {
  position: relative; padding: 1.8rem 1.5rem 1.8rem; background: var(--ink);
  border: 3px solid var(--grey-700); border-top: 12px solid var(--blue);
  transition: border-color .2s, transform .2s;
}
.skill:hover { border-color: var(--blue); transform: translateY(-4px); }
.skill h3 { font-size: 1.5rem; font-weight: 800; margin-bottom: .7rem; }
.skill p { color: var(--grey-300); }

/* Parcours */
.timeline { list-style: none; margin: 0; padding: 0; max-width: 900px; border-left: 6px solid var(--ink); }
.timeline li { display: grid; grid-template-columns: 11rem 1fr; gap: 1.5rem; padding: 0 0 2.5rem 2rem; position: relative; }
.timeline li::before {
  content: ""; position: absolute; left: -17px; top: .35rem; width: 28px; height: 28px;
  background: var(--blue); border: 3px solid var(--ink);
}
.timeline li:last-child { padding-bottom: 0; }
.timeline time { font-weight: 700; color: var(--blue); padding-top: .2rem; }
.timeline h3 { font-size: 1.35rem; font-weight: 800; margin-bottom: .3rem; }
.timeline p { color: var(--grey-700); }

/* Contact */
.contact { background: var(--blue); color: #fff; padding: clamp(4rem, 9vw, 7rem) var(--pad); border-top: 3px solid var(--ink); }
.contact-inner { max-width: 46rem; }
.contact h2 { font-size: clamp(2.4rem, 5.5vw, 4.5rem); font-weight: 900; font-stretch: 105%; margin-bottom: 1.2rem; }
.contact p { max-width: 38ch; }
.contact-mail { margin-top: 1.5rem; font-family: var(--font-display); font-size: 1.4rem; font-weight: 800; }
.contact-mail a { text-underline-offset: 6px; }
.form { background: var(--white); color: var(--ink); border: 3px solid var(--ink); box-shadow: 10px 10px 0 var(--ink); padding: 2rem; display: grid; gap: 1.2rem; }
.form label { display: grid; gap: .4rem; font-weight: 700; }
.form input, .form textarea {
  font: inherit; font-weight: 400; padding: .8rem; border: 3px solid var(--ink); background: var(--grey-50); border-radius: 0; width: 100%;
}
.form input:focus, .form textarea:focus { outline: none; border-color: var(--blue); background: #fff; }
.form input:invalid:not(:placeholder-shown):not(:focus), .form .touched:invalid { border-color: #C4123A; }
.form .btn { justify-self: start; }
.form-status { min-height: 1.4rem; font-weight: 700; color: var(--blue-deep); }

/* Pied de page */
.site-footer {
  display: flex; flex-wrap: wrap; gap: 1rem 2rem; align-items: center; justify-content: space-between;
  padding: 1.6rem var(--pad); background: var(--ink); color: var(--grey-300); font-size: .95rem;
}
.socials { display: flex; gap: 1.5rem; }
.site-footer a { text-underline-offset: 4px; }
.site-footer a:hover { color: #fff; }

/* ===== Responsive ===== */
@media (max-width: 1100px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
  .skills { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 860px) {
  .facts { grid-template-columns: 1fr; }
  .facts div { border-right: 0; border-bottom: 3px solid var(--ink); }
  .facts div:last-child { border-bottom: 0; }
  .music-inner { grid-template-columns: 1fr; gap: 2.5rem; }
  .contact-inner { grid-template-columns: 1fr; gap: 3rem; }
  .menu-btn { display: block; }
  .nav {
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--grey-100); border-bottom: 3px solid var(--ink);
    display: none;
  }
  .nav.open { display: flex; }
  .nav a { padding: 1rem var(--pad); border-top: 2px solid var(--grey-300); }
}
@media (max-width: 600px) {
  .grid, .skills { grid-template-columns: 1fr; }
  .timeline li { grid-template-columns: 1fr; gap: .2rem; }
  .card { box-shadow: 7px 7px 0 var(--blue); }
  .form { padding: 1.4rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .sway, .cloud, .portrait-float, .portrait-shadow, .portrait-clip img { animation: none; }
  .par { transform: none; }
  .tiles { display: none; }
  * { transition: none !important; }
}


/* ===== Projets GitHub, musique, contact ===== */
a.card { text-decoration: none; color: inherit; }
.more { margin-top: 3rem; }
.langs { margin-top: 4rem; }
.langs h3 { font-size: 1.6rem; font-weight: 800; margin-bottom: 1rem; }
.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .8rem; }
.chips li { font-weight: 700; padding: .45rem 1rem; background: #fff; border: 3px solid var(--ink); box-shadow: 4px 4px 0 var(--blue); }
.chips b { color: var(--blue); margin-left: .4rem; }

.music-inner { display: grid; grid-template-columns: .8fr 1.2fr; gap: 4rem; align-items: center; }
.music h2 { font-size: clamp(2.2rem, 5vw, 4rem); font-weight: 900; font-stretch: 105%; margin-bottom: 1.2rem; }
.music-text p { max-width: 40ch; color: var(--grey-300); margin-bottom: 2rem; }
.music .btn-primary { border-color: #fff; box-shadow: 5px 5px 0 #fff; }
.player { background: #fff; border: 3px solid #fff; box-shadow: 12px 12px 0 var(--blue); line-height: 0; }
.player iframe { display: block; width: 100%; height: 450px; border: 0; }

.contact-inner p { max-width: 40ch; }
.links { display: flex; flex-wrap: wrap; gap: 1.2rem; margin-top: 2.2rem; }
.contact .btn-primary { background: #fff; color: var(--ink); }
.contact .btn-ghost { background: var(--ink); color: #fff; }
.contact :focus-visible { outline-color: #fff; }
