/* =========================================================
   Portfolio — Techno Solutions
   Couleurs : modifiez uniquement le bloc :root ci-dessous.
   ========================================================= */
:root {
  --ink: #14161a;          /* noir principal */
  --ink-soft: #4a4e55;     /* texte secondaire */
  --paper: #f4f4f2;        /* fond clair */
  --concrete: #dcdcd8;     /* gris béton */
  --tint: #eaeae7;         /* fond de section alterné */
  --line: rgba(20, 22, 26, .16);
  --line-light: rgba(244, 244, 242, .18);

  --font: "Helvetica Neue", Helvetica, Arial, "Segoe UI", sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "SF Mono", Consolas, monospace;
  --header-h: 68px;
  --wrap: 1180px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: var(--header-h); }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3, p { margin: 0; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.section-dark :focus-visible { outline-color: var(--paper); }
.mono { font-family: var(--mono); font-size: .78rem; letter-spacing: .04em; }

/* ---------- En-tête ---------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  height: var(--header-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 clamp(16px, 4vw, 48px);
  background: rgba(244, 244, 242, .72);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-mark { width: auto; height: 44px; }
.brand-name {
  font-weight: 500; font-size: .82rem; letter-spacing: .22em;
  text-transform: uppercase; line-height: 1.15;
  display: flex; flex-direction: column;
}
.brand-name b { font-weight: 800; }

.nav { display: flex; align-items: center; gap: clamp(16px, 2.6vw, 36px); }
.nav a {
  text-decoration: none; font-size: .82rem; letter-spacing: .12em;
  text-transform: uppercase; font-weight: 500; position: relative; padding: 6px 0;
}
.nav a:not(.nav-cta)::after {
  content: ""; position: absolute; left: 0; right: 100%; bottom: 0; height: 1px;
  background: var(--ink); transition: right .25s ease;
}
.nav a:not(.nav-cta):hover::after { right: 0; }
.nav-cta { background: var(--ink); color: var(--paper); padding: 10px 18px !important; transition: background .2s; }
.nav-cta:hover { background: #2b2f36; }

.nav-toggle { display: none; background: none; border: 0; width: 44px; height: 44px; cursor: pointer; position: relative; }
.nav-toggle span { position: absolute; left: 10px; right: 10px; height: 2px; background: var(--ink); transition: transform .25s, top .25s; }
.nav-toggle span:first-child { top: 17px; }
.nav-toggle span:last-child { top: 25px; }
.nav-toggle[aria-expanded="true"] span:first-child { top: 21px; transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:last-child { top: 21px; transform: rotate(-45deg); }

/* ---------- Héros ---------- */
.hero {
  position: relative;
  min-height: 100vh; min-height: 100svh;
  display: grid; place-items: center;
  padding: calc(var(--header-h) + 24px) 20px 96px;
  background:
    linear-gradient(to bottom, rgba(244,244,242,0) 70%, var(--paper) 100%),
    url("fond.jpg") center / cover no-repeat;
  background-color: var(--concrete);
  text-align: center;
}
.hero-inner { width: min(440px, 100%); display: flex; flex-direction: column; align-items: center; }
.eyebrow {
  font-family: var(--mono); font-size: .72rem; letter-spacing: .18em;
  text-transform: uppercase; color: var(--ink-soft);
}
.hero-logo { width: min(300px, 62vw); height: auto; margin: 10px 0 0;
  filter: drop-shadow(0 0 14px rgba(244,244,242,.9)); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hero-lead { margin-top: 18px; font-size: 1rem; color: #2b2f36; max-width: 38ch; }
.hero-actions { margin-top: 28px; display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 13px 26px; font: 600 .8rem/1 var(--font); letter-spacing: .14em; text-transform: uppercase;
  text-decoration: none; border: 1px solid var(--ink); cursor: pointer;
  transition: background .2s, color .2s;
}
.btn-solid { background: var(--ink); color: var(--paper); }
.btn-solid:hover { background: #2b2f36; }
.btn-ghost { background: rgba(244, 244, 242, .55); color: var(--ink); }
.btn-ghost:hover { background: var(--ink); color: var(--paper); }
.btn-sm { padding: 10px 16px; font-size: .72rem; }

.scroll-hint { position: absolute; bottom: 28px; left: 50%; width: 26px; height: 42px; margin-left: -13px; border: 1.5px solid var(--ink); border-radius: 14px; }
.scroll-hint span { position: absolute; left: 50%; top: 8px; width: 3px; height: 8px; margin-left: -1.5px; background: var(--ink); border-radius: 2px; animation: hint 1.8s ease-in-out infinite; }
@keyframes hint { 0% { transform: translateY(0); opacity: 1; } 70% { transform: translateY(14px); opacity: 0; } 100% { opacity: 0; } }

/* ---------- Sections ---------- */
.section { padding: clamp(72px, 10vw, 128px) 0; }
.section-tint { background: var(--tint); }
.section-dark { background: var(--ink); color: var(--paper); }
.wrap { width: min(var(--wrap), 100% - 2 * clamp(20px, 5vw, 56px)); margin-inline: auto; }

.section-head {
  display: grid; grid-template-columns: auto 1fr; column-gap: 18px; align-items: baseline;
  margin-bottom: clamp(32px, 5vw, 56px);
  padding-bottom: 20px; border-bottom: 1px solid var(--line);
}
.section-dark .section-head { border-color: var(--line-light); }
.section-head .index { font-family: var(--mono); font-size: .8rem; color: var(--ink-soft); grid-row: 1; }
.section-dark .section-head .index { color: rgba(244, 244, 242, .6); }
.section-head h2 { font-size: clamp(1.8rem, 3.6vw, 2.6rem); font-weight: 800; letter-spacing: .02em; text-transform: uppercase; line-height: 1.1; }
.section-head p { grid-column: 2; margin-top: 10px; color: var(--ink-soft); max-width: 60ch; }
.section-dark .section-head p { color: rgba(244, 244, 242, .7); }

/* ---------- Projets ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
.chip {
  font: 500 .76rem/1 var(--font); letter-spacing: .12em; text-transform: uppercase;
  padding: 11px 18px; background: transparent; color: var(--ink);
  border: 1px solid var(--line); cursor: pointer; transition: all .2s;
}
.chip:hover { border-color: var(--ink); }
.chip.is-active { background: var(--ink); color: var(--paper); border-color: var(--ink); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 28px 24px; }
.card[hidden] { display: none; }
.card-media {
  position: relative; display: block; width: 100%; aspect-ratio: 4 / 3; padding: 0;
  border: 1px solid var(--line); background: var(--concrete); overflow: hidden; cursor: zoom-in;
}
.card-media .ph {
  position: absolute; inset: 0; display: grid; place-items: center;
  background:
    repeating-linear-gradient(45deg, transparent 0 14px, rgba(20, 22, 26, .045) 14px 15px),
    linear-gradient(135deg, #e6e6e3, #cfcfcb);
  font-family: var(--mono); font-size: .74rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-soft);
}
.card-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .6s cubic-bezier(.2, .7, .2, 1); }
.card-media:hover img { transform: scale(1.04); }
.card-body { padding: 16px 2px 0; }
.card-body h3 { font-size: 1.02rem; font-weight: 700; letter-spacing: .01em; }
.card-body .meta { margin-top: 4px; font-family: var(--mono); font-size: .74rem; letter-spacing: .06em; color: var(--ink-soft); text-transform: uppercase; }

/* ---------- Compétences ---------- */
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 48px 40px; }
.col h3 { font-family: var(--mono); font-size: .76rem; font-weight: 500; letter-spacing: .18em; text-transform: uppercase; color: rgba(244, 244, 242, .6); margin-bottom: 20px; }
.tags { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.tags li { padding: 10px 16px; border: 1px solid var(--line-light); font-size: .92rem; font-weight: 500; }
.ruled { list-style: none; margin: 0; padding: 0; }
.ruled li { padding: 14px 0; border-top: 1px solid var(--line-light); display: flex; flex-direction: column; gap: 2px; }
.ruled li:last-child { border-bottom: 1px solid var(--line-light); }
.ruled span { font-weight: 600; }
.ruled em { font-style: normal; font-size: .86rem; color: rgba(244, 244, 242, .6); }

/* ---------- Visionneuse 3D ---------- */
.viewer { position: relative; border: 1px solid var(--line); background: #fff; }
.viewer-canvas {
  height: clamp(340px, 58vh, 600px); cursor: grab; touch-action: none;
  background: radial-gradient(ellipse at 50% 30%, #ffffff 0%, #e9e9e6 70%, #dcdcd8 100%);
}
.viewer-canvas:active { cursor: grabbing; }
.viewer-canvas canvas { display: block; width: 100%; height: 100%; }
.viewer-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--line); }
.viewer-bar .btn { margin: 0; }
.viewer-drop {
  position: absolute; inset: 0; display: none; place-items: center; z-index: 2;
  background: rgba(20, 22, 26, .78); color: var(--paper);
  font-size: 1.1rem; letter-spacing: .16em; text-transform: uppercase; border: 2px dashed var(--paper); margin: 10px;
}
.viewer.is-drag .viewer-drop { display: grid; }

/* ---------- À propos ---------- */
.about { display: grid; grid-template-columns: 1fr; gap: 0; }
.about-text { max-width: 62ch; display: grid; gap: 18px; }
.about-text .lead { font-size: clamp(1.25rem, 2.4vw, 1.7rem); font-weight: 600; line-height: 1.35; }
.about-text p:not(.lead) { color: var(--ink-soft); }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); margin: 48px 0 0; border-top: 1px solid var(--line); }
.facts div { padding: 20px 0; }
.facts dt { font-family: var(--mono); font-size: .72rem; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-soft); }
.facts dd { margin: 6px 0 0; font-size: 1.1rem; font-weight: 600; }

/* ---------- Contact ---------- */
.contact-lead { font-size: clamp(1.1rem, 2vw, 1.4rem); color: var(--ink-soft); margin-bottom: 8px; }
.contact-mail {
  display: inline-block; font-size: clamp(1.4rem, 4.6vw, 3.2rem); font-weight: 800; letter-spacing: .01em;
  text-decoration: none; padding-bottom: 6px; background: linear-gradient(var(--ink), var(--ink)) left bottom / 100% 2px no-repeat;
  word-break: break-word; transition: background-size .35s ease;
}
.contact-mail:hover { background-size: 0 2px; background-position: right bottom; }

/* ---------- Pied de page ---------- */
.site-footer {
  display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between;
  padding: 24px clamp(16px, 4vw, 48px); background: var(--ink); color: rgba(244, 244, 242, .75);
  font-family: var(--mono); font-size: .76rem; letter-spacing: .06em;
}
.site-footer a { text-decoration: none; }
.site-footer a:hover { color: var(--paper); }

/* ---------- Visionneuse d'images ---------- */
.lightbox { border: 0; padding: 0; background: transparent; max-width: 100vw; max-height: 100vh; width: 100%; height: 100%; }
.lightbox::backdrop { background: rgba(10, 11, 13, .92); }
.lightbox[open] { display: grid; place-items: center; align-content: center; gap: 12px; }
.lightbox img { max-width: min(94vw, 1500px); max-height: 82vh; object-fit: contain; }
.lightbox p { color: rgba(244, 244, 242, .8); }
.lightbox-close { position: absolute; top: 14px; right: 18px; width: 48px; height: 48px; background: none; border: 0; color: var(--paper); font-size: 2.4rem; line-height: 1; cursor: pointer; }

/* ---------- Mobile ---------- */
@media (max-width: 820px) {
  .nav-toggle { display: block; }
  .nav {
    position: absolute; top: var(--header-h); left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--paper); border-bottom: 1px solid var(--line);
    max-height: 0; overflow: hidden; transition: max-height .3s ease;
  }
  .nav.is-open { max-height: 380px; }
  .nav a { padding: 16px clamp(16px, 4vw, 48px); border-top: 1px solid var(--line); }
  .nav a:not(.nav-cta)::after { display: none; }
  .nav-cta { margin: 14px clamp(16px, 4vw, 48px); text-align: center; }
  .viewer-bar { flex-direction: column; align-items: stretch; text-align: center; }
  .viewer-left { justify-content: center; }
  .viewer-right .btn { flex: 1; }
  .viewer-right { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Ajouts : PDF, descriptions, visionneuse multi-formats ---------- */
.empty { color: var(--ink-soft); padding: 24px 0; }
.card-media .badge {
  position: absolute; top: 10px; left: 10px; padding: 5px 9px; background: var(--ink); color: var(--paper);
  font: 700 .68rem/1 var(--mono); letter-spacing: .14em;
}
.card-body .desc { margin-top: 8px; font-size: .92rem; color: var(--ink-soft); }

.viewer-status {
  position: absolute; left: 50%; top: 18px; transform: translateX(-50%); z-index: 3; max-width: calc(100% - 32px);
  padding: 10px 16px; background: var(--ink); color: var(--paper); font-size: .86rem; text-align: center;
}
.viewer-status.is-error { background: #8f2424; }
.viewer-left { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; min-width: 0; }
.viewer-left select {
  max-width: 100%; padding: 9px 12px; font: 500 .85rem var(--font); background: #fff; color: var(--ink);
  border: 1px solid var(--ink); border-radius: 0;
}
.viewer-right { display: flex; gap: 8px; flex-shrink: 0; }
.viewer-note { margin-top: 12px; color: var(--ink-soft); }

.lb-title { color: var(--paper); font-weight: 700; letter-spacing: .02em; }
.lb-desc { color: rgba(244, 244, 242, .75); max-width: 60ch; text-align: center; font-size: .92rem; }
.lb-pdf { margin-top: 4px; background: var(--paper); color: var(--ink); border-color: var(--paper); }
.lb-pdf:hover { background: transparent; color: var(--paper); }
.lightbox[open] { text-align: center; }
