:root {
  --bg: #EEF0F5;
  --ink: #14162B;
  --ink-soft: #565B7A;
  --line: #D9DCE8;
  --card: #FFFFFF;
  --accent-a: #3D5AFE;
  --accent-b: #FF3D77;
  --grad: linear-gradient(120deg, var(--accent-a), var(--accent-b));
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter', sans-serif;
}
img { max-width: 100%; display: block; }
a { color: inherit; }

/* ---------- HEADER ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 40px;
  background: rgba(238,240,245,0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.logo svg { height: 64px; width: auto; display: block; }
.main-nav { display: flex; gap: 24px; }
.main-nav a {
  font-size: 0.9rem; font-weight: 600; text-decoration: none;
  color: var(--ink-soft); transition: color 0.2s ease;
  white-space: nowrap;
}
.main-nav a:hover { color: var(--ink); }
.burger {
  display: none; flex-direction: column; justify-content: center; gap: 5px;
  background: none; border: none; cursor: pointer; padding: 6px;
  width: 36px; height: 36px;
}
.burger span { width: 24px; height: 2px; background: var(--ink); display: block; transition: 0.25s ease; transform-origin: center; }
.burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Tablette : resserre avant que ça ne déborde */
@media (max-width: 980px) {
  .site-header { padding: 14px 28px; }
  .main-nav { gap: 16px; }
  .main-nav a { font-size: 0.85rem; }
  .logo svg { height: 54px; }
}

@media (max-width: 860px) {
  .site-header { padding: 14px 20px; }
  .logo svg { height: 48px; }
  .main-nav {
    position: absolute; top: 100%; left: 0; right: 0;
    background: var(--bg); flex-direction: column; gap: 0;
    max-height: 0; overflow: hidden; border-bottom: 1px solid var(--line);
    transition: max-height 0.3s ease;
  }
  .main-nav.open { max-height: 360px; }
  .main-nav a { padding: 14px 24px; border-top: 1px solid var(--line); font-size: 0.95rem; }
  .burger { display: flex; }
}

/* ---------- SHARED SECTION LAYOUT ---------- */
main > section { max-width: 1140px; margin: 0 auto; padding: 90px 24px; }
@media (max-width: 860px) { main > section { padding: 64px 20px; } }
@media (max-width: 500px) { main > section { padding: 48px 16px; } }
.grid-label {
  font-family: 'Space Mono', monospace; font-size: 0.75rem;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-soft); margin-bottom: 22px;
}
.eyebrow {
  font-family: 'Space Mono', monospace; font-size: 0.75rem;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--ink-soft); display: flex; align-items: center; gap: 10px;
  margin-bottom: 26px;
}
.eyebrow::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--grad); display: inline-block; }

.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.in-view { opacity: 1; transform: translateY(0); }

/* ---------- HERO ---------- */
.hero {
  position: relative;
  overflow: hidden;
  background: #0d0f22;
  min-height: 88vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 120px 24px 80px;
}
#heroCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}
.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 780px;
}
.hero-content .eyebrow { color: #9aa0d8; justify-content: center; }
.headline {
  font-family: 'Fraunces', serif; font-weight: 600; color: #fff;
  font-size: clamp(2rem, 5.5vw, 4rem); line-height: 1.1;
  letter-spacing: -0.01em; margin: 0 auto 28px; max-width: 780px;
}
.headline em {
  font-style: italic; font-weight: 500; background: var(--grad);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.sub { font-size: 1.08rem; color: #b8bce0; max-width: 520px; line-height: 1.6; margin: 0 auto 36px; }
.cta-row { display: flex; align-items: center; justify-content: center; gap: 22px; flex-wrap: wrap; }
.btn {
  font-weight: 600; font-size: 0.95rem; color: #fff; background: var(--grad);
  padding: 15px 30px; border-radius: 100px; text-decoration: none;
  display: inline-flex; align-items: center; gap: 8px; border: none; cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.btn:hover { transform: translateY(-3px); box-shadow: 0 12px 28px rgba(61,90,254,0.35); }
.btn-ghost {
  font-weight: 600; font-size: 0.95rem; color: #fff; text-decoration: none;
  border-bottom: 2px solid rgba(255,255,255,0.5); padding-bottom: 2px;
  transition: border-color 0.2s ease;
}
.btn-ghost:hover { border-color: #fff; }

@media (max-width: 600px) {
  .hero { min-height: 78vh; padding: 100px 20px 60px; }
}

/* ---------- MARQUEE ---------- */
.marquee-wrap {
  margin: 20px 0 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  padding: 18px 0; overflow: hidden; white-space: nowrap;
}
.marquee { display: inline-flex; gap: 48px; animation: scroll 22s linear infinite; }
.marquee span { font-family: 'Space Mono', monospace; font-size: 0.85rem; letter-spacing: 0.04em; color: var(--ink-soft); text-transform: uppercase; }
.marquee span.accent { color: var(--accent-b); }
@keyframes scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ---------- ABOUT ---------- */
.about { display: grid; grid-template-columns: 260px 1fr; gap: 50px; align-items: center; }
.about-photo img { border-radius: 20px; box-shadow: 0 20px 40px rgba(20,22,43,0.1); }
.about-text h2 { font-family: 'Fraunces', serif; font-weight: 600; font-size: 1.9rem; margin: 0 0 18px; }
.about-text p { color: var(--ink-soft); line-height: 1.65; margin: 0 0 14px; }
@media (max-width: 720px) {
  .about { grid-template-columns: 1fr; gap: 28px; text-align: center; }
  .about-photo { max-width: 200px; margin: 0 auto; }
}

/* ---------- SKILLS ---------- */
.skills-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.skill-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 20px 22px;
  box-shadow: 0 8px 20px rgba(20,22,43,0.04);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.skill-card:hover { transform: translateY(-4px); box-shadow: 0 16px 32px rgba(20,22,43,0.08); }
.skill-top { display: flex; justify-content: space-between; font-weight: 600; margin-bottom: 12px; }
.skill-bar { height: 6px; border-radius: 100px; background: var(--line); overflow: hidden; }
.skill-bar span { display: block; height: 100%; background: var(--grad); border-radius: 100px; transition: width 1s ease; }
@media (max-width: 720px) { .skills-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .skills-grid { grid-template-columns: 1fr; } }

/* ---------- SLIDER ---------- */
.slider-section { padding-bottom: 0; }
.slider {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--line);
}
.slider-track { display: flex; transition: transform 0.5s ease; }
.slide { flex: 0 0 100%; position: relative; }
.slide img { width: 100%; height: 600px; object-fit: cover; display: block; }
.slide-caption {
  position: absolute; left: 0; bottom: 0; right: 0;
  padding: 24px 28px; background: linear-gradient(to top, rgba(20,22,43,0.82), transparent);
  color: #fff;
}
.slide-caption .tag { color: #fff; opacity: 0.85; }
.slide-caption h3 { font-family: 'Fraunces', serif; font-weight: 600; font-size: 1.5rem; margin: 6px 0 0; }
.slider-btn {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 44px; height: 44px; border-radius: 50%; border: none; cursor: pointer;
  background: rgba(255,255,255,0.9); color: var(--ink); display: flex; align-items: center; justify-content: center;
  transition: background 0.2s ease;
}
.slider-btn:hover { background: #fff; }
.slider-btn.prev { left: 16px; }
.slider-btn.next { right: 16px; }
.slider-dots { display: flex; justify-content: center; gap: 8px; margin-top: 18px; }
.slider-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--line); border: none; cursor: pointer; padding: 0; }
.slider-dot.active { background: var(--grad); width: 22px; border-radius: 100px; transition: width 0.25s ease; }
@media (max-width: 980px) { .slide img { height: 420px; } }
@media (max-width: 600px) { .slide img { height: 260px; } .slider-btn { width: 38px; height: 38px; } }

/* ---------- BENTO PROJECTS ---------- */
.bento { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.card {
  position: relative; background: var(--card); border: 1px solid var(--line); border-radius: 20px;
  overflow: hidden; text-decoration: none; color: var(--ink); display: flex; flex-direction: column;
  transition: transform 0.35s ease, box-shadow 0.35s ease;
}
.card:hover { transform: translateY(-6px); box-shadow: 0 24px 40px rgba(20,22,43,0.12); }
.card.span2 { grid-column: span 2; }
.thumb { height: 190px; position: relative; background: linear-gradient(135deg, #dfe2ee, #eef0f5); overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.card:hover .thumb img { transform: scale(1.06); }
.card-body { padding: 22px 24px 26px; flex: 1; display: flex; flex-direction: column; }
.tag { font-family: 'Space Mono', monospace; font-size: 0.7rem; letter-spacing: 0.05em; text-transform: uppercase; color: var(--accent-a); margin-bottom: 10px; }
.card h3 { font-family: 'Fraunces', serif; font-weight: 600; font-size: 1.4rem; margin: 0 0 10px; }
.card p { font-size: 0.95rem; color: var(--ink-soft); line-height: 1.55; margin: 0 0 18px; flex: 1; }
.arrow { font-weight: 600; font-size: 0.88rem; display: inline-flex; align-items: center; gap: 6px; }
.arrow svg { transition: transform 0.3s ease; }
.card:hover .arrow svg { transform: translateX(5px); }
@media (max-width: 820px) { .bento { grid-template-columns: 1fr; } .card.span2 { grid-column: span 1; } }

/* ---------- TIMELINE ---------- */
.timeline-list { position: relative; padding-left: 30px; border-left: 2px solid var(--line); }
.timeline-item { position: relative; padding-bottom: 40px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-dot {
  position: absolute; left: -37px; top: 4px; width: 12px; height: 12px; border-radius: 50%;
  background: var(--grad); box-shadow: 0 0 0 4px rgba(61,90,254,0.12);
}
.timeline-date { font-family: 'Space Mono', monospace; font-size: 0.75rem; color: var(--accent-a); text-transform: uppercase; letter-spacing: 0.05em; }
.timeline-content h3 { font-family: 'Fraunces', serif; font-weight: 600; margin: 8px 0 8px; }
.timeline-content p { color: var(--ink-soft); line-height: 1.6; margin: 0; }
@media (max-width: 500px) {
  .timeline-list { padding-left: 22px; }
  .timeline-dot { left: -28px; }
}

/* ---------- CONTACT FORM ---------- */
.contact h2 { font-family: 'Fraunces', serif; font-weight: 600; font-size: 1.9rem; margin: 6px 0 30px; }
.contact-form { display: flex; flex-direction: column; gap: 18px; max-width: 640px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form-group { display: flex; flex-direction: column; gap: 8px; }
.form-group label { font-size: 0.85rem; font-weight: 600; color: var(--ink-soft); }
.form-group input, .form-group textarea {
  border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px;
  font-family: 'Inter', sans-serif; font-size: 0.95rem; background: var(--card); color: var(--ink);
  resize: vertical;
}
.form-group input:focus, .form-group textarea:focus { outline: 2px solid var(--accent-a); outline-offset: 1px; }
.hp-field { position: absolute; left: -9999px; top: -9999px; }
.form-feedback { font-size: 0.9rem; font-weight: 600; min-height: 1.2em; }
.form-feedback.success { color: #1a9d5c; }
.form-feedback.error { color: var(--accent-b); }
@media (max-width: 600px) { .form-row { grid-template-columns: 1fr; } }

/* ---------- FOOTER ---------- */
.site-footer { max-width: 1140px; margin: 0 auto 60px; padding: 0 24px; }
.footer-inner {
  border-radius: 28px; background: var(--ink); padding: 64px 48px; position: relative; overflow: hidden; color: #fff;
}
@media (max-width: 720px) { .footer-inner { padding: 48px 32px; border-radius: 22px; } .site-footer { margin-bottom: 40px; padding: 0 16px; } }
@media (max-width: 480px) { .footer-inner { padding: 40px 22px; } }
.footer-inner::before {
  content: ""; position: absolute; width: 420px; height: 420px; right: -140px; top: -160px;
  background: var(--grad); filter: blur(90px); opacity: 0.55; border-radius: 50%;
}
.footer-inner > * { position: relative; z-index: 1; }
.footer-inner .eyebrow { color: rgba(255,255,255,0.6); }
.footer-inner h2 { font-family: 'Fraunces', serif; font-weight: 600; font-size: clamp(1.7rem, 3vw, 2.4rem); margin: 0 0 26px; max-width: 560px; }
.footer-inner .btn { background: #fff; color: var(--ink); }
.footer-inner .btn:hover { box-shadow: 0 12px 28px rgba(0,0,0,0.35); }
.socials { display: flex; gap: 14px; margin-top: 34px; flex-wrap: wrap; }
.social-link {
  width: 44px; height: 44px; border-radius: 50%; background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.18); display: flex; align-items: center; justify-content: center;
  color: #fff; transition: transform 0.25s ease, background 0.25s ease;
}
.social-link:hover { transform: translateY(-4px); background: var(--grad); border-color: transparent; }
.social-link svg { width: 19px; height: 19px; }
.copyright { margin-top: 34px; font-size: 0.85rem; color: rgba(255,255,255,0.5); }

@media (prefers-reduced-motion: reduce) {
  .marquee { animation: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
}
