/* =======================
   Variables & base
   ======================= */
:root {
  --bg: #0d0f12;
  --fg: #eaecef;
  --muted: #a3a7b3;
  --accent: #2f4c79;
  --line: #2a2f3a;
  --panel: #10141a;
  --border: #ffffff1a;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.6 system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, 'Helvetica Neue', Arial;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

.container {
  width: min(1100px, 92%);
  margin: 0 auto;
}

.section {
  padding: 88px 0;
}

.section-title {
  font-size: 28px;
  letter-spacing: .02em;
  margin: 0 0 28px 0;
}

/* =======================
   Side Scroll-Spy Nav
   ======================= */
.side-nav {
  position: fixed;
  top: 50%;
  right: 24px;
  transform: translateY(-50%);
  z-index: 30;
  background: rgba(13, 15, 18, .6);
  backdrop-filter: saturate(140%) blur(8px);
  border: 1px solid rgba(255, 255, 255, .06);
  border-radius: 14px;
  padding: 10px 8px;
}

.side-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  position: relative;
}

.side-nav a {
  display: block;
  padding: 8px 14px;
  margin: 4px 0;
  color: var(--muted);
  font-size: 14px;
  border-radius: 10px;
  white-space: nowrap;
  transition: color .2s ease, background .2s ease, transform .2s ease;
}

.side-nav a:hover {
  color: var(--fg);
  transform: translateX(-2px);
}

.side-nav a.active {
  color: var(--fg);
  background: #ffffff12;
}

/* Indicateur actif */
.side-nav .spy-indicator {
  position: absolute;
  right: 6px;
  width: 3px;
  height: 28px;
  background: linear-gradient(var(--accent), #4a658e);
  border-radius: 999px;
  transform: translateY(0);
  transition: transform .25s ease, height .25s ease, opacity .25s ease;
  opacity: .8;
}

/* Responsive : masquer sur petits écrans (option) */
@media (max-width: 980px) {
  .side-nav {
    display: none;
  }
}

/* Respect du mode réduit de mouvement */
@media (prefers-reduced-motion: reduce) {
  .side-nav .spy-indicator {
    transition: none;
  }

  .side-nav a {
    transition: none;
  }
}

/* =======================
   Hero
   ======================= */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.hero-inner {
  position: relative;
  z-index: 2;
  max-width: 820px;
  margin: 0 auto;
}

.hero-fore {
  position: relative;
}

.hero-back {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.hero h1 {
  font-size: 40px;
  line-height: 1.2;
  margin: 0 0 10px 0;
}

.accent {
  color: var(--accent);
}

.tagline {
  color: var(--muted);
  margin: 0 0 22px 0;
}

.cta-row {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.btn {
  padding: 10px 16px;
  background: var(--fg);
  color: #0b0d10;
  border-radius: 10px;
  border: 1px solid #fff2;
}

.btn.ghost {
  background: transparent;
  color: var(--fg);
  border: 1px solid #fff3;
}

.btn:hover {
  transform: translateY(-1px);
}

/* Orbs décor */
.orb {
  position: absolute;
  width: 70vmin;
  height: 70vmin;
  border-radius: 50%;
  filter: blur(30px);
  opacity: .18;
}

.orb-a {
  background: radial-gradient(circle at 30% 30%, #5bd7ff, transparent 60%);
  top: -8%;
  left: -35%;
}

.orb-b {
  background: radial-gradient(circle at 70% 70%, #ef3527, transparent 60%);
  bottom: -13%;
  right: -25%;
}

/* =======================
   Projets (grid areas)
   ======================= */
.projects .project {
  display: grid;
  grid-template-columns: 1.15fr .95fr;
  /* image gauche, texte droite */
  grid-template-areas:
    "media content"
    "details details";
  gap: 28px;
  align-items: center;
  margin-bottom: 56px;
}

.projects .project.reverse {
  grid-template-columns: .95fr 1.15fr;
  /* texte gauche, image droite */
  grid-template-areas:
    "content media"
    "details details";
}

/* Zones */
.projects .project .project-media-wrap {
  grid-area: media;
}

.projects .project .project-content {
  grid-area: content;
}

.projects .project .project-details {
  grid-area: details;
}

/* Carte image */
.project-media-wrap {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: #0b0d10;
}

.project-media {
  position: relative;
  width: 100%;
  padding-top: 62%;
}

/* ratio ~16:10 */
.project-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: translateZ(0) scale(1.06);
}

/* Texte */
.project-content h3 {
  margin: 0 0 8px 0;
  font-size: 22px;
}

.project-content .summary {
  margin: 0 0 10px 0;
  color: var(--muted);
}

/* CTA En savoir plus */
.more-toggle {
  margin-top: 6px;
  padding: 8px 12px;
  font: inherit;
  border-radius: 10px;
  border: 1px solid #ffffff22;
  background: #ffffff10;
  color: var(--fg);
  cursor: pointer;
  transition: transform .15s ease, background .2s ease, border-color .2s ease;
}

.more-toggle:hover {
  transform: translateY(-1px);
  background: #ffffff15;
  border-color: #ffffff33;
}

.more-toggle[aria-expanded="true"] {
  background: #ffffff1f;
}

/* Panneau de détails */
.project-details {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--panel);
}

.project-details[hidden] {
  display: none !important;
}

.details-inner {
  padding: 18px 20px;
}

.project-details p {
  margin: 0 0 10px 0;
  color: #cfd3dd;
}

/* Média dans le panneau (image + vidéo) */
.project-details figure {
  margin: 14px auto;
  max-width: 820px;
}

.project-details figure img {
  border-radius: 12px;
}

.project-details figure figcaption {
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  margin-top: 6px;
}

.video-wrap {
  position: relative;
  max-width: 820px;
  margin: 16px auto;
  aspect-ratio: 16/9;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.video-wrap iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ====== Version mobile : Titre → Photo → Résumé → Bouton → Détails ====== */
@media (max-width: 768px) {
  .projects .project {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .projects .project .project-content {
    display: contents;
  }

  /* permet d'ordonner h3, .summary, .more-toggle */
  .projects .project h3 {
    order: 1;
  }

  .projects .project .project-media-wrap {
    order: 2;
  }

  .projects .project .summary {
    order: 3;
  }

  .projects .project .more-toggle {
    order: 4;
    align-self: center;
  }

  .projects .project .project-details {
    order: 5;
  }
}

/* --- Liste pipeline --- */
.pipeline {
  margin: 10px 0 16px 18px;
}

.pipeline li {
  margin: 6px 0;
}

/* --- Console code block --- */
.code-console {
  position: relative;
  background: radial-gradient(120% 140% at 10% 10%, #0b0f14 0%, #0a0d12 60%, #090c11 100%);
  border: 1px solid #ffffff18;
  border-radius: 12px;
  padding: 16px 14px 14px 14px;
  overflow: auto;
  box-shadow: 0 10px 26px rgba(0, 0, 0, .35), inset 0 0 0 1px #00000066;
  color: #dbe6ff;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 13.5px;
  line-height: 1.55;
}

.code-console::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 28px;
  background: linear-gradient(180deg, #0f141a 0%, #0c1117 100%);
  border-bottom: 1px solid #ffffff14;
  border-radius: 12px 12px 0 0;
}

.code-console::after {
  /* pastilles façon terminal */
  content: "●  ●  ●";
  position: absolute;
  top: 6px;
  left: 12px;
  font-size: 10px;
  letter-spacing: 4px;
  color: #6b7280;
}

/* --- Token colors minimalistes --- */
.code-console .cm {
  color: #7ea2c8;
  font-style: italic;
}

/* comments */
.code-console .kw {
  color: #86e1fc;
}

/* keywords */
.code-console .ty {
  color: #ffd479;
}

/* types */
.code-console .st {
  color: #b8ffa6;
}

/* pseudo-strings/labels */
.code-console .fn {
  color: #ffb3a7;
}

/* functions */
.code-console .id {
  color: #e5c07b;
}

/* identifiers */
.code-console .num {
  color: #c6a0f6;
}

/* numbers */

/* Optionnel : atténue le paragraphe d’avertissement */
.muted {
  color: var(--muted);
}


/* =======================
   Split detail (texte | sep | image)
   ======================= */
.split-detail {
  display: grid;
  grid-template-columns: 1fr 1px 1.1fr;
  /* texte | séparateur | image */
  gap: 24px;
  align-items: start;
  margin: 16px 0;
}

.split-detail.reverse {
  grid-template-columns: 1.1fr 1px 1fr;
  /* image plus large si reverse */
}

.split-detail.reverse .sd-text {
  order: 3;
}

.split-detail.reverse .sd-sep {
  order: 2;
}

.split-detail.reverse .sd-figure {
  order: 1;
}

.split-detail .sd-text {
  min-width: 0;
  text-align: justify;
}

.split-detail .sd-text h4 {
  margin: 0 0 8px 0;
}

.split-detail .sd-text p {
  margin: 0 0 10px 0;
  color: #cfd3dd;
}

/* harmonisé avec .project-details p */
.split-detail .sd-text ul {
  margin: 8px 0 12px 18px;
}

.split-detail .sd-sep {
  width: 1px;
  background: linear-gradient(var(--line), var(--border));
  border-radius: 999px;
  align-self: stretch;
  opacity: .9;
}

.split-detail .sd-figure {
  margin: 0;
  /* hérite déjà d’un style figure global dans project-details */
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.split-detail .sd-figure img {
  width: 100%;
  height: auto;
  display: block;
  border: 1px solid var(--border);
  border-radius: 12px;
  object-fit: cover;
}

.split-detail .sd-figure figcaption {
  text-align: center;
  font-size: 13px;
  color: var(--muted);
}

/* ===== Responsive =====
   - < 860px : pile en colonne
   - le séparateur devient une fine ligne horizontale
*/
@media (max-width: 860px) {
  .split-detail {
    display: flex;
    flex-direction: column;
    gap: 14px;
  }

  .split-detail .sd-sep {
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, var(--line), var(--border));
  }

  /* Ordre : texte au-dessus de l’image */
  .split-detail .sd-text {
    order: 1;
  }

  .split-detail .sd-sep {
    order: 2;
  }

  .split-detail .sd-figure {
    order: 3;
  }
}

.tags {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 0;
  padding: 0;
}

.tag {
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #ffffff10;
  font-size: 13px;
  line-height: 1;
  white-space: nowrap;
  transition: .2s ease;
}

.tag:hover {
  background: #ffffff18;
  transform: translateY(-1px);
}

.skills-cards {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
}

.skill-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
}

.skill-card h5 {
  margin: 0 0 6px;
  font-size: 15px;
}

.skill-card p {
  margin: 0;
  color: #cfd3dd;
}

@media(max-width:540px) {
  .tag {
    font-size: 12.5px;
    padding: 6px 9px;
  }

  .skills-cards {
    grid-template-columns: 1fr;
  }
}

/* =======================
   Timeline
   ======================= */
.timeline-section {
  position: relative;
}

.timeline {
  position: relative;
  padding-left: 46px;
}

.timeline-line {
  position: absolute;
  left: 20px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--line);
  overflow: hidden;
}

.timeline-line::after {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 0;
  background: linear-gradient(var(--accent), #4a658e);
}

.timeline-item {
  display: flex;
  gap: 16px;
  margin: 0 0 24px 0;
  opacity: 0;
  transform: translateY(10px);
  transition: .6s ease;
}

.timeline-item.visible {
  opacity: 1;
  transform: none;
}

.timeline-item .logo {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  display: block;
  border: none;
  border-radius: 0;
  background: transparent;
  object-fit: contain;
  object-position: center;
  image-rendering: auto;
  padding: 2px;
  /* léger espace autour */
}

.ti-content h4 {
  margin: 0 0 4px 0;
  font-size: 18px;
}

.period {
  font-size: 13px;
  color: var(--muted);
}

@media (max-width: 900px) {
  .timeline {
    padding-left: 38px;
  }

  .timeline-line {
    left: 16px;
  }
}

/* ===== Contact en 2/3 + 1/3 ===== */
.contact-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  /* 2/3 – 1/3 */
  gap: 24px;
  align-items: start;
}

.contact-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 20px;
}

.contact-list {
  list-style: none;
  margin: 8px 0 0 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.contact-list li {
  display: grid;
  grid-template-columns: 120px 1fr;
  align-items: baseline;
  gap: 8px;
}

.contact-list .label {
  color: var(--muted);
  font-size: 14px;
}

/* Bloc portrait à droite */
.contact-portrait {
  margin: 0;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px;
  text-align: center;
}

.contact-portrait img {
  width: 100%;
  aspect-ratio: 3 / 4;
  /* portrait vertical */
  object-fit: cover;
  border-radius: 12px;
  /* bords arrondis demandés */
  display: block;
}

.contact-portrait figcaption {
  margin-top: 8px;
  font-size: 13px;
  color: var(--muted);
}

/* Responsive : pile en colonne */
@media (max-width: 860px) {
  .contact-grid {
    grid-template-columns: 1fr;
    /* 100% */
  }

  .contact-portrait {
    max-width: 360px;
    margin: 0 auto;
    /* centrer la photo */
  }
}

/* =======================
   Footer & liens
   ======================= */
.contact-inner p a {
  color: var(--accent);
}

.site-footer {
  border-top: 1px solid rgba(255, 255, 255, .06);
  padding: 18px 0;
  color: var(--muted);
  font-size: 14px;
}

/* =======================
   Parallax & Canvas bruit
   ======================= */
.parallax {
  will-change: transform;
}

.parallax-img img {
  will-change: transform;
}

/* Canvas de bruit : sous le contenu mais au-dessus du background */
#noise-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  display: block;
  width: 100vw;
  height: 100vh;
}

/* Tout le contenu du site au-dessus du canvas */
.site-header,
.section,
.site-footer {
  position: relative;
  z-index: 1;
}