/* =====================================================================
   Portfolio — Romain Coste
   Feuille de style principale
   Palette d'origine conservée : #6093D5 (bleu) · #304254 (ardoise)
   ===================================================================== */

/* ------------------------------ 1. TOKENS ---------------------------- */

:root {
  /* Couleurs de marque */
  --brand:        #6093D5;
  --brand-dark:   #3E6FAF;
  --brand-light:  #8FB6E4;
  --slate:        #304254;
  --slate-deep:   #0E1318;

  /* Thème clair (par défaut) */
  --bg:           #FFFFFF;
  --bg-alt:       #F4F7FB;
  --bg-elev:      #FFFFFF;
  --bg-inset:     #EDF2F9;

  --text:         #1B2733;
  --text-soft:    #55677C;
  /* #5F7285 plutôt qu'un gris plus clair : garde 4.6:1 minimum sur les
     fonds clairs, seuil AA pour les petits textes (légendes, libellés). */
  --text-faint:   #5F7285;

  --accent:       #3E6FAF;
  --accent-hover: #2F5A93;
  --accent-soft:  rgba(96, 147, 213, .12);
  --accent-ring:  rgba(96, 147, 213, .38);

  --border:       #DDE5EF;
  --border-soft:  #EAF0F7;

  --shadow-sm:    0 1px 2px rgba(16, 32, 51, .06),
                  0 2px 6px rgba(16, 32, 51, .05);
  --shadow-md:    0 4px 12px rgba(16, 32, 51, .07),
                  0 12px 28px rgba(16, 32, 51, .07);
  --shadow-lg:    0 8px 24px rgba(16, 32, 51, .10),
                  0 24px 56px rgba(16, 32, 51, .10);

  /* Rythme */
  --container:    1140px;
  --gutter:       clamp(1.15rem, 4vw, 2.5rem);
  --section-y:    clamp(4.5rem, 9vw, 7.5rem);
  --radius:       16px;
  --radius-sm:    10px;
  --radius-lg:    24px;

  --header-h:     68px;

  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
          "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", "SFMono-Regular", Menlo, Consolas,
               "Liberation Mono", monospace;

  --ease: cubic-bezier(.22, .61, .36, 1);
}

/* Thème sombre — suit le système par défaut… */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:          #0E1318;
    --bg-alt:      #131A22;
    --bg-elev:     #18212B;
    --bg-inset:    #1D2833;

    --text:        #E8EEF5;
    --text-soft:   #A3B2C4;
    --text-faint:  #7A8A9C;

    --accent:       #7DACE6;
    --accent-hover: #9CC3EF;
    --accent-soft:  rgba(125, 172, 230, .14);
    --accent-ring:  rgba(125, 172, 230, .40);

    --border:      #263341;
    --border-soft: #1E2833;

    --shadow-sm:   0 1px 2px rgba(0, 0, 0, .40);
    --shadow-md:   0 4px 12px rgba(0, 0, 0, .40),
                   0 12px 28px rgba(0, 0, 0, .32);
    --shadow-lg:   0 8px 24px rgba(0, 0, 0, .46),
                   0 24px 56px rgba(0, 0, 0, .38);
  }
}

/* …mais le bouton l'emporte dans les deux sens. */
:root[data-theme="dark"] {
  --bg:          #0E1318;
  --bg-alt:      #131A22;
  --bg-elev:     #18212B;
  --bg-inset:    #1D2833;

  --text:        #E8EEF5;
  --text-soft:   #A3B2C4;
  --text-faint:  #7A8A9C;

  --accent:       #7DACE6;
  --accent-hover: #9CC3EF;
  --accent-soft:  rgba(125, 172, 230, .14);
  --accent-ring:  rgba(125, 172, 230, .40);

  --border:      #263341;
  --border-soft: #1E2833;

  --shadow-sm:   0 1px 2px rgba(0, 0, 0, .40);
  --shadow-md:   0 4px 12px rgba(0, 0, 0, .40),
                 0 12px 28px rgba(0, 0, 0, .32);
  --shadow-lg:   0 8px 24px rgba(0, 0, 0, .46),
                 0 24px 56px rgba(0, 0, 0, .38);
}

/* ------------------------------ 2. RESET ----------------------------- */

*, *::before, *::after { box-sizing: border-box; }

* { margin: 0; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

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

ul, ol { list-style: none; padding: 0; }

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

button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

h1, h2, h3, h4 { line-height: 1.18; font-weight: 700; letter-spacing: -.02em; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  left: 50%;
  top: -100px;
  transform: translateX(-50%);
  z-index: 999;
  padding: .7rem 1.2rem;
  background: var(--accent);
  color: #fff;
  border-radius: 0 0 10px 10px;
  font-weight: 600;
  transition: top .2s var(--ease);
}
.skip-link:focus { top: 0; }

/* ----------------------------- 3. LAYOUT ----------------------------- */

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section { padding-block: var(--section-y); }
.section-alt { background: var(--bg-alt); }

.section-head { max-width: 46rem; margin-bottom: clamp(2.5rem, 5vw, 3.75rem); }

.section-kicker {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: .85rem;
}
.section-kicker::before {
  content: "";
  width: 26px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
}

.section-title {
  font-size: clamp(1.85rem, 4.2vw, 2.85rem);
  color: var(--text);
}

.section-sub {
  margin-top: .9rem;
  font-size: clamp(1rem, 1.6vw, 1.1rem);
  color: var(--text-soft);
  max-width: 42rem;
}

/* ----------------------------- 4. HEADER ----------------------------- */

.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  height: var(--header-h);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .25s var(--ease), background .25s var(--ease);
}
.site-header.is-stuck {
  border-bottom-color: var(--border);
  box-shadow: var(--shadow-sm);
}

.header-inner {
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 1rem;
}

.brand { display: inline-flex; align-items: center; gap: .7rem; margin-right: auto; }

.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--brand) 0%, var(--slate) 100%);
  color: #fff;
  font-size: .82rem;
  font-weight: 800;
  letter-spacing: .04em;
  flex: none;
}

.brand-name { font-weight: 700; letter-spacing: -.015em; }

.nav-list { display: flex; align-items: center; gap: .15rem; }

.nav-list a {
  position: relative;
  display: block;
  padding: .5rem .8rem;
  border-radius: 9px;
  font-size: .93rem;
  font-weight: 500;
  color: var(--text-soft);
  transition: color .2s var(--ease), background .2s var(--ease);
}
.nav-list a:hover { color: var(--text); background: var(--accent-soft); }

.nav-list a.is-active { color: var(--accent); font-weight: 600; }
.nav-list a.is-active::after {
  content: "";
  position: absolute;
  left: .8rem;
  right: .8rem;
  bottom: .18rem;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
}

.header-actions { display: flex; align-items: center; gap: .4rem; }

.icon-btn {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 11px;
  border: 1px solid var(--border);
  color: var(--text-soft);
  background: var(--bg-elev);
  transition: color .2s var(--ease), border-color .2s var(--ease),
              background .2s var(--ease), transform .15s var(--ease);
}
.icon-btn:hover { color: var(--accent); border-color: var(--accent-ring); }
.icon-btn:active { transform: scale(.94); }
.icon-btn svg {
  width: 19px; height: 19px;
  fill: none; stroke: currentColor;
  stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round;
}

/* Bascule soleil / lune */
.icon-moon { display: none; }
:root[data-theme="dark"] .icon-sun { display: none; }
:root[data-theme="dark"] .icon-moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .icon-sun  { display: none; }
  :root:not([data-theme="light"]) .icon-moon { display: block; }
}

/* Burger */
.burger { display: none; flex-direction: column; gap: 4px; }
.burger span {
  display: block;
  width: 18px; height: 2px;
  border-radius: 2px;
  background: currentColor;
  transition: transform .28s var(--ease), opacity .2s var(--ease);
}
.burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.scroll-progress {
  position: absolute;
  left: 0; bottom: -1px;
  height: 2px;
  width: 0;
  background: linear-gradient(90deg, var(--brand), var(--accent));
  transition: width .1s linear;
}

/* ------------------------------ 5. HERO ------------------------------ */

.hero {
  position: relative;
  padding-top: calc(var(--header-h) + clamp(3rem, 8vw, 6rem));
  padding-bottom: clamp(4rem, 9vw, 7rem);
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(900px 480px at 12% -10%, var(--accent-soft), transparent 62%),
    radial-gradient(700px 420px at 92% 8%,  var(--accent-soft), transparent 60%);
}
.hero-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, var(--border-soft) 1px, transparent 1px),
    linear-gradient(to bottom, var(--border-soft) 1px, transparent 1px);
  background-size: 58px 58px;
  mask-image: radial-gradient(ellipse 78% 62% at 50% 0%, #000 20%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse 78% 62% at 50% 0%, #000 20%, transparent 78%);
  opacity: .8;
}

.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr);
  gap: clamp(2.5rem, 5vw, 4.5rem);
  align-items: center;
}

.eyebrow {
  display: inline-block;
  padding: .34rem .8rem;
  border-radius: 999px;
  border: 1px solid var(--accent-ring);
  background: var(--accent-soft);
  color: var(--accent);
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.hero-title {
  margin-top: 1.15rem;
  font-size: clamp(2.6rem, 7.5vw, 4.6rem);
  letter-spacing: -.035em;
  background: linear-gradient(135deg, var(--text) 30%, var(--accent) 115%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-role {
  margin-top: 1.1rem;
  font-size: clamp(1.02rem, 1.9vw, 1.2rem);
  color: var(--text-soft);
  line-height: 1.6;
}
.hero-role strong { color: var(--text); font-weight: 650; }

.hero-lead {
  margin-top: 1.15rem;
  max-width: 34rem;
  color: var(--text-soft);
}

.hero-cta { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 2rem; }

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem 1.6rem;
  margin-top: 2.1rem;
  padding-top: 1.6rem;
  border-top: 1px solid var(--border);
  font-size: .9rem;
  color: var(--text-soft);
}
.hero-meta li { display: inline-flex; align-items: center; gap: .5rem; }
.hero-meta svg {
  width: 16px; height: 16px; flex: none;
  fill: none; stroke: var(--accent);
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
.hero-meta a { border-bottom: 1px solid transparent; transition: border-color .2s var(--ease); }
.hero-meta a:hover { border-bottom-color: currentColor; }

/* Carte « terminal » */
.hero-card {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--slate-deep);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.hero-card-head {
  display: flex;
  align-items: center;
  gap: .45rem;
  padding: .8rem 1.1rem;
  background: rgba(255, 255, 255, .04);
  border-bottom: 1px solid rgba(255, 255, 255, .07);
}
.dot { width: 11px; height: 11px; border-radius: 50%; flex: none; }
.dot-r { background: #FF5F57; }
.dot-y { background: #FEBC2E; }
.dot-g { background: #28C840; }

.hero-card-title {
  margin-left: .6rem;
  font-family: var(--font-mono);
  font-size: .78rem;
  color: rgba(255, 255, 255, .42);
}

.hero-card-body {
  margin: 0;
  padding: 1.35rem 1.4rem 1.6rem;
  font-family: var(--font-mono);
  font-size: clamp(.74rem, 1.15vw, .84rem);
  line-height: 1.85;
  color: #C7D4E4;
  overflow-x: auto;
}
.hero-card-body code { font: inherit; }
.c-key    { color: var(--brand-light); font-weight: 600; }
.c-key::before { content: "$ "; color: #5C7185; }
.c-out    { color: #93A6BC; }
.c-prompt { color: var(--brand); animation: blink 1.15s steps(2, start) infinite; }

@keyframes blink { to { visibility: hidden; } }

/* ---------------------------- 6. BOUTONS ----------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  padding: .78rem 1.35rem;
  border-radius: 11px;
  border: 1px solid transparent;
  font-size: .94rem;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  transition: transform .16s var(--ease), box-shadow .2s var(--ease),
              background .2s var(--ease), border-color .2s var(--ease),
              color .2s var(--ease);
}
.btn svg {
  width: 17px; height: 17px; flex: none;
  fill: none; stroke: currentColor;
  stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round;
}
.btn:hover  { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 14px var(--accent-ring);
}
.btn-primary:hover { background: var(--accent-hover); box-shadow: 0 8px 22px var(--accent-ring); }
:root[data-theme="dark"] .btn-primary { color: var(--slate-deep); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .btn-primary { color: var(--slate-deep); }
}

.btn-ghost {
  background: var(--bg-elev);
  border-color: var(--border);
  color: var(--text);
}
.btn-ghost:hover { border-color: var(--accent-ring); color: var(--accent); }

.btn-outline {
  background: transparent;
  border-color: var(--accent-ring);
  color: var(--accent);
}
.btn-outline:hover { background: var(--accent-soft); }

.btn-sm { padding: .6rem 1.05rem; font-size: .88rem; border-radius: 10px; }

/* --------------------------- 7. À PROPOS ----------------------------- */

.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}

.about-text p + p { margin-top: 1.1rem; }
.about-text p { font-size: clamp(1rem, 1.5vw, 1.08rem); color: var(--text-soft); }
.about-text strong { color: var(--text); font-weight: 650; }

.stats { display: grid; gap: .9rem; }

.stat {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  padding: 1.15rem 1.35rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-elev);
  box-shadow: var(--shadow-sm);
}
.stat-num {
  font-size: 1.9rem;
  font-weight: 800;
  letter-spacing: -.03em;
  color: var(--accent);
  line-height: 1;
  flex: none;
  min-width: 2.6rem;
}
.stat-unit { font-size: .9rem; margin-left: .12rem; }
/* Une valeur textuelle (« Tier 3+ ») ne peut pas porter la taille d'un chiffre */
.stat-num-sm { font-size: 1.25rem; min-width: 4.4rem; letter-spacing: -.01em; }
.stat-label { font-size: .93rem; color: var(--text-soft); line-height: 1.45; }

/* -------------------------- 8. FORMATIONS ---------------------------- */

.timeline { position: relative; display: grid; gap: clamp(1.5rem, 3vw, 2.25rem); }
.timeline::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 10px;
  bottom: 10px;
  width: 2px;
  border-radius: 2px;
  background: linear-gradient(to bottom, var(--accent), var(--border) 92%);
}

.timeline-item { position: relative; padding-left: clamp(2rem, 4vw, 2.75rem); }

.timeline-marker {
  position: absolute;
  left: 0;
  top: 1.9rem;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--bg);
  border: 3px solid var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.tl-card {
  display: grid;
  grid-template-columns: 208px minmax(0, 1fr);
  gap: clamp(1.1rem, 2.5vw, 1.9rem);
  align-items: center;
  padding: 1.35rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-elev);
  box-shadow: var(--shadow-sm);
  transition: transform .3s var(--ease), box-shadow .3s var(--ease),
              border-color .3s var(--ease);
}
.tl-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent-ring);
  box-shadow: var(--shadow-md);
}

.tl-media {
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg-inset);
  aspect-ratio: 16 / 10;
}
.tl-media img { width: 100%; height: 100%; object-fit: cover; }

/* Photo de l'établissement + pastille des logos officiels par-dessus */
.tl-media-photo { position: relative; }

.tl-logos {
  position: absolute;
  left: .5rem;
  bottom: .5rem;
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .35rem .5rem;
  border-radius: 9px;
  background: rgba(14, 19, 24, .74);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.tl-logos img { width: auto; height: 22px; object-fit: contain; }
/* Le logo IUT est blanc : lisible tel quel sur la pastille sombre.
   Celui de l'université est foncé, il lui faut son propre fond clair. */
.tl-logos .logo-on-white {
  background: #fff;
  border-radius: 5px;
  padding: 2px;
}

.tl-date {
  display: flex;
  align-items: center;
  gap: .6rem;
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--accent);
}

.badge {
  padding: .18rem .58rem;
  border-radius: 999px;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: none;
}
.badge-live {
  background: rgba(40, 200, 100, .14);
  color: #127040;
  border: 1px solid rgba(40, 200, 100, .3);
}
:root[data-theme="dark"] .badge-live { color: #4ED88C; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .badge-live { color: #4ED88C; }
}

.tl-title { margin-top: .55rem; font-size: clamp(1.1rem, 2vw, 1.28rem); }
.tl-org   { margin-top: .3rem; font-size: .95rem; font-weight: 600; color: var(--text-soft); }
.tl-desc  { margin-top: .7rem; font-size: .95rem; color: var(--text-soft); }
.tl-desc strong { color: var(--text); font-weight: 650; }

/* ---------------------------- 9. PROJETS ----------------------------- */

.project {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.12fr);
  gap: clamp(1.75rem, 4.5vw, 3.5rem);
  align-items: start;
  padding-block: clamp(2.25rem, 5vw, 3.5rem);
}
.project + .project { border-top: 1px solid var(--border); }

/* Rangée inversée : le texte passe à gauche, mais chaque colonne garde
   la même largeur que dans une rangée normale. */
.project-reverse { grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr); }
.project-reverse .project-media { order: 2; }

/* min-width: 0 — sans ça, un enfant à largeur minimale (le schéma défilable
   sur mobile) élargit la colonne au lieu de défiler dans son cadre. */
.project-media,
.project-body { min-width: 0; }

.project-media { position: sticky; top: calc(var(--header-h) + 24px); }
.project-media figure { margin: 0; }

.zoomable {
  display: block;
  position: relative;
  width: 100%;
  padding: 0;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  box-shadow: var(--shadow-md);
  transition: transform .3s var(--ease), box-shadow .3s var(--ease),
              border-color .3s var(--ease);
}
.zoomable:hover {
  transform: translateY(-3px);
  border-color: var(--accent-ring);
  box-shadow: var(--shadow-lg);
}
.zoomable img { width: 100%; background: #fff; }

.zoom-hint {
  position: absolute;
  right: .7rem;
  bottom: .7rem;
  display: inline-flex;
  align-items: center;
  gap: .38rem;
  padding: .38rem .68rem;
  border-radius: 8px;
  background: rgba(14, 19, 24, .82);
  backdrop-filter: blur(6px);
  color: #fff;
  font-size: .76rem;
  font-weight: 600;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity .25s var(--ease), transform .25s var(--ease);
}
.zoomable:hover .zoom-hint,
.zoomable:focus-visible .zoom-hint { opacity: 1; transform: translateY(0); }
.zoom-hint svg {
  width: 14px; height: 14px;
  fill: none; stroke: currentColor;
  stroke-width: 2; stroke-linecap: round;
}

figcaption {
  margin-top: .8rem;
  font-size: .84rem;
  line-height: 1.55;
  color: var(--text-faint);
  text-align: center;
}

/* Schéma SVG du projet III */
.schema {
  padding: 1.4rem 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-elev);
  box-shadow: var(--shadow-md);
}
.schema svg { width: 100%; height: auto; }
.schema .node rect {
  fill: var(--bg-inset);
  stroke: var(--border);
  stroke-width: 1.5;
}
.schema .node-accent rect { fill: var(--accent-soft); stroke: var(--accent); }
.schema .node-soft rect   { fill: transparent; stroke: var(--border); stroke-dasharray: 4 3; }
.schema text {
  text-anchor: middle;
  font-family: var(--font);
  fill: var(--text-soft);
}
.schema .n-title { font-size: 12.5px; font-weight: 700; fill: var(--text); }
.schema .n-sub   { font-size: 10.5px; }
.schema .t-line  { font-size: 9.5px; fill: var(--accent); font-weight: 600; }
.schema .cred    { font-size: 10px; fill: var(--accent); font-weight: 600; }
.schema .tunnel-label {
  font-size: 10px;
  fill: var(--text-faint);
  font-style: italic;
}
.schema .tunnel rect { fill: var(--accent-soft); stroke: var(--accent); stroke-width: 1.2; }
.schema .link {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
  stroke-linecap: round;
}
.schema .hint {
  fill: none;
  stroke: var(--border);
  stroke-width: 1.4;
  stroke-dasharray: 3 3;
}
.schema .hb {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.4;
  stroke-dasharray: 3 2;
}
.schema .hb-label { font-size: 8.5px; fill: var(--text-faint); }

.project-num {
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--accent);
}

.project-title {
  margin-top: .65rem;
  font-size: clamp(1.35rem, 2.9vw, 1.85rem);
}

.project-desc { margin-top: 1.15rem; }
.project-desc p { color: var(--text-soft); }
.project-desc p + p { margin-top: .85rem; }
.project-desc strong { color: var(--text); font-weight: 650; }

.subproject {
  margin-top: 1.4rem;
  padding: 1.1rem 1.25rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  background: var(--bg-alt);
}
.section-alt .subproject { background: var(--bg); }
.subproject h4 { font-size: 1rem; color: var(--text); }

.bullets { margin-top: .7rem; display: grid; gap: .5rem; }
.bullets li {
  position: relative;
  padding-left: 1.35rem;
  font-size: .93rem;
  color: var(--text-soft);
}
.bullets li::before {
  content: "";
  position: absolute;
  left: .3rem;
  top: .62em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}
.bullets strong { color: var(--text); font-weight: 650; }

.skills-title {
  margin-top: 1.7rem;
  margin-bottom: .8rem;
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.chips { display: flex; flex-wrap: wrap; gap: .45rem; }
.chips li {
  padding: .35rem .75rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  font-size: .82rem;
  font-weight: 500;
  color: var(--text-soft);
  transition: border-color .2s var(--ease), color .2s var(--ease);
}
.chips li:hover { border-color: var(--accent-ring); color: var(--text); }

.chips-accent li {
  border-color: var(--accent-ring);
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}
.chips-sm li { font-size: .76rem; padding: .28rem .6rem; }

.project-links { display: flex; flex-wrap: wrap; gap: .65rem; margin-top: 1.8rem; }

/* Format et poids du fichier, pour que le visiteur sache ce qu'il ouvre.
   Pas d'opacité ici : elle délave le texte sous le seuil de contraste AA.
   Le séparateur et la taille suffisent à le poser en second plan. */
.file-meta {
  padding-left: .55rem;
  margin-left: .1rem;
  border-left: 1px solid currentColor;
  font-size: .78rem;
  font-weight: 500;
}
.file-meta::before { content: ""; }

.file-note {
  margin-top: .7rem;
  font-size: .82rem;
  color: var(--text-faint);
}
.file-note code {
  padding: .1rem .35rem;
  border-radius: 5px;
  background: var(--bg-inset);
  color: var(--text-soft);
  font-family: var(--font-mono);
  font-size: .92em;
}

/* ------------------------------ 10. CV ------------------------------- */

.cv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(268px, 1fr));
  gap: clamp(1rem, 2vw, 1.4rem);
}

.card {
  padding: 1.6rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-elev);
  box-shadow: var(--shadow-sm);
  transition: transform .3s var(--ease), box-shadow .3s var(--ease),
              border-color .3s var(--ease);
}
.card:hover {
  transform: translateY(-4px);
  border-color: var(--accent-ring);
  box-shadow: var(--shadow-md);
}

.card-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
  margin-bottom: 1.1rem;
}
.card-icon svg {
  width: 21px; height: 21px;
  fill: none; stroke: currentColor;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}

.card-title { font-size: 1.08rem; margin-bottom: 1rem; }

.list-check { display: grid; gap: .55rem; }
.list-check li {
  position: relative;
  padding-left: 1.6rem;
  font-size: .94rem;
  color: var(--text-soft);
}
.list-check li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .38em;
  width: 15px;
  height: 8px;
  border-left: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  transform: rotate(-45deg) scale(.78);
  transform-origin: left center;
  border-radius: 1px;
}

.lang-list { display: grid; gap: 1.05rem; }
.lang-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: .8rem;
  margin-bottom: .45rem;
  font-size: .94rem;
  font-weight: 600;
}
.lang-level { font-size: .82rem; font-weight: 500; color: var(--text-faint); }

.bar {
  height: 7px;
  border-radius: 999px;
  background: var(--bg-inset);
  overflow: hidden;
}
.bar i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand), var(--accent));
  transition: width 1.1s var(--ease) .15s;
}
.is-visible .bar i { width: var(--v); }

/* -------------------------- 11. EXPÉRIENCES -------------------------- */

.xp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: clamp(1rem, 2vw, 1.4rem);
}

.xp {
  display: flex;
  flex-direction: column;
  padding: 1.6rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-elev);
  box-shadow: var(--shadow-sm);
  transition: transform .3s var(--ease), box-shadow .3s var(--ease),
              border-color .3s var(--ease);
}
.xp:hover {
  transform: translateY(-4px);
  border-color: var(--accent-ring);
  box-shadow: var(--shadow-md);
}

.xp-featured {
  grid-column: 1 / -1;
  border-color: var(--accent-ring);
  background:
    linear-gradient(135deg, var(--accent-soft), transparent 55%),
    var(--bg-elev);
}

.xp-date {
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--accent);
}
.xp-title { margin-top: .5rem; font-size: 1.1rem; }
.xp-org   { margin-top: .3rem; font-size: .9rem; font-weight: 600; color: var(--text-faint); }
.xp-org a { color: var(--accent); border-bottom: 1px solid transparent; }
.xp-org a:hover { border-bottom-color: currentColor; }
.xp-desc  { margin-top: .8rem; font-size: .93rem; color: var(--text-soft); }
.xp .chips { margin-top: 1.1rem; }

/* --------------------------- 12. CONTACT ----------------------------- */

.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: clamp(1rem, 2vw, 1.4rem);
}

.contact-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .3rem;
  padding: 1.7rem 1.5rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-elev);
  box-shadow: var(--shadow-sm);
  transition: transform .3s var(--ease), box-shadow .3s var(--ease),
              border-color .3s var(--ease);
}
.contact-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent-ring);
  box-shadow: var(--shadow-md);
}

.contact-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 13px;
  background: var(--accent-soft);
  color: var(--accent);
  margin-bottom: .95rem;
}
.contact-icon svg {
  width: 22px; height: 22px;
  fill: none; stroke: currentColor;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
.contact-icon-in svg { fill: currentColor; stroke: none; }
.contact-icon-img { background: transparent; padding: 2px; }
.contact-icon-img img { width: 100%; height: auto; object-fit: contain; }

.contact-label {
  font-size: .74rem;
  font-weight: 800;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.contact-value {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-size: 1rem;
  font-weight: 650;
  color: var(--text);
  word-break: break-word;
}
.contact-value .ext {
  width: 13px; height: 13px;
  fill: none; stroke: var(--text-faint);
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}

/* ---------------------------- 13. FOOTER ----------------------------- */

.site-footer {
  padding-block: clamp(2.5rem, 5vw, 3.5rem);
  border-top: 1px solid var(--border);
  background: var(--bg-alt);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem 2rem;
}

.footer-brand { display: flex; align-items: center; gap: .85rem; }
.footer-name { font-weight: 700; }
.footer-role { font-size: .85rem; color: var(--text-faint); }

.footer-nav { display: flex; flex-wrap: wrap; gap: .3rem 1.2rem; }
.footer-nav a {
  font-size: .9rem;
  color: var(--text-soft);
  border-bottom: 1px solid transparent;
  transition: color .2s var(--ease), border-color .2s var(--ease);
}
.footer-nav a:hover { color: var(--accent); border-bottom-color: currentColor; }

.footer-copy {
  width: 100%;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  font-size: .84rem;
  color: var(--text-faint);
}

/* --------------------- 14. BOUTON RETOUR EN HAUT --------------------- */

.to-top {
  position: fixed;
  right: clamp(1rem, 3vw, 1.75rem);
  bottom: clamp(1rem, 3vw, 1.75rem);
  z-index: 90;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 13px;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--accent);
  box-shadow: var(--shadow-md);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity .28s var(--ease), transform .28s var(--ease),
              visibility .28s var(--ease);
}
.to-top.is-visible { opacity: 1; visibility: visible; transform: translateY(0); }
.to-top:hover { border-color: var(--accent-ring); }
.to-top svg {
  width: 19px; height: 19px;
  fill: none; stroke: currentColor;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}

/* --------------------------- 15. LIGHTBOX ---------------------------- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: clamp(1rem, 4vw, 3rem);
  background: rgba(8, 12, 16, .92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity .25s var(--ease);
}
.lightbox:not([hidden]) { opacity: 1; }
.lightbox[hidden] { display: none; }

.lightbox-figure { margin: 0; max-width: 100%; max-height: 100%; }
.lightbox-figure img {
  max-width: 100%;
  max-height: 78vh;
  width: auto;
  margin-inline: auto;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .6);
}
.lightbox-figure figcaption {
  margin-top: 1.1rem;
  max-width: 46rem;
  margin-inline: auto;
  color: rgba(255, 255, 255, .74);
  font-size: .9rem;
}

.lightbox-close {
  position: absolute;
  top: clamp(.8rem, 2.5vw, 1.5rem);
  right: clamp(.8rem, 2.5vw, 1.5rem);
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, .18);
  background: rgba(255, 255, 255, .08);
  color: #fff;
  transition: background .2s var(--ease);
}
.lightbox-close:hover { background: rgba(255, 255, 255, .18); }
.lightbox-close svg {
  width: 20px; height: 20px;
  fill: none; stroke: currentColor;
  stroke-width: 2; stroke-linecap: round;
}

body.no-scroll { overflow: hidden; }

/* -------------------------- 16. ANIMATIONS --------------------------- */

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .65s var(--ease), transform .65s var(--ease);
}
.reveal.is-visible { opacity: 1; transform: none; }

/* Décalage progressif dans les grilles */
.cv-grid  .reveal:nth-child(2),
.xp-grid  .reveal:nth-child(2),
.contact-grid .reveal:nth-child(2) { transition-delay: .07s; }
.cv-grid  .reveal:nth-child(3),
.xp-grid  .reveal:nth-child(3),
.contact-grid .reveal:nth-child(3) { transition-delay: .14s; }
.cv-grid  .reveal:nth-child(4),
.xp-grid  .reveal:nth-child(4),
.contact-grid .reveal:nth-child(4) { transition-delay: .21s; }
.cv-grid  .reveal:nth-child(5),
.xp-grid  .reveal:nth-child(5) { transition-delay: .28s; }
.cv-grid  .reveal:nth-child(6),
.xp-grid  .reveal:nth-child(6) { transition-delay: .35s; }
.cv-grid  .reveal:nth-child(7) { transition-delay: .42s; }
.cv-grid  .reveal:nth-child(8) { transition-delay: .49s; }

.hero-text .reveal:nth-child(2) { transition-delay: .06s; }
.hero-text .reveal:nth-child(3) { transition-delay: .12s; }
.hero-text .reveal:nth-child(4) { transition-delay: .18s; }
.hero-text .reveal:nth-child(5) { transition-delay: .24s; }
.hero-text .reveal:nth-child(6) { transition-delay: .30s; }

/* --------------------------- 17. RESPONSIVE -------------------------- */

@media (max-width: 1024px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-card  { max-width: 560px; }
  .project,
  .project-reverse { grid-template-columns: 1fr; }
  .project-reverse .project-media { order: 0; }
  .project-media { position: static; }
  .about-grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
}

/* Sous ~640 px, un schéma réduit à la largeur de l'écran rend son texte
   illisible (moins de 7 px). On lui garde une largeur minimale et on laisse
   le cadre défiler horizontalement. */
@media (max-width: 640px) {
  .schema {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .schema svg { min-width: 460px; }
  .schema + figcaption::after,
  figure .schema ~ figcaption::after {
    content: " — faites glisser pour explorer";
    color: var(--accent);
  }
}

@media (max-width: 860px) {
  .burger { display: flex; }

  .nav {
    position: fixed;
    inset: var(--header-h) 0 auto 0;
    max-height: 0;
    overflow: hidden;
    background: var(--bg);
    border-bottom: 1px solid transparent;
    transition: max-height .34s var(--ease), border-color .34s var(--ease);
  }
  .nav.is-open {
    max-height: 60vh;
    overflow-y: auto;
    border-bottom-color: var(--border);
    box-shadow: var(--shadow-md);
  }
  .nav-list {
    flex-direction: column;
    align-items: stretch;
    gap: .15rem;
    padding: .75rem var(--gutter) 1.25rem;
  }
  .nav-list a { padding: .8rem 1rem; font-size: 1rem; }
  .nav-list a.is-active::after { display: none; }
  .nav-list a.is-active { background: var(--accent-soft); }

  .tl-card { grid-template-columns: 1fr; }
  .tl-media { aspect-ratio: 16 / 7; }
}

@media (max-width: 520px) {
  .brand-name { display: none; }
  .hero-card-body { font-size: .7rem; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
  .stat { padding: 1rem 1.1rem; }
  .btn { width: 100%; }
  .project-links .btn { width: auto; }

  /* Cibles tactiles confortables pour les liens du pied de page */
  .footer-nav { gap: 0 .4rem; margin-inline: -.6rem; }
  .footer-nav a { padding: .6rem; }
}

/* ------------------- 18. ACCESSIBILITÉ / IMPRESSION ------------------ */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .reveal { opacity: 1; transform: none; }
  .bar i { width: var(--v); }
}

@media print {
  .site-header, .to-top, .lightbox, .hero-card,
  .hero-bg, .zoom-hint, .footer-nav { display: none !important; }
  body { background: #fff; color: #000; }
  .section { padding-block: 1.5rem; page-break-inside: avoid; }
  .reveal { opacity: 1 !important; transform: none !important; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: .75em; color: #555; }
}
