/* Portfolio de Pablo Bellissant
   Une seule famille, Inter Variable (graisse et taille optique), hébergée localement :
   c'est la police que Pablo a appris à parser avec FontRenderer.
   Fond gris neutre pour ne pas fausser les couleurs des rendus ; encre bleu nuit reprise du CV. */

@font-face {
  font-family: "Inter Variable";
  src: url("fonts/inter-variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Couleurs */
  --paper: #f0f0ef;        /* gris neutre, sans dominante */
  --ink: #1c2232;          /* bleu nuit du CV, assombri pour le texte */
  --ink-2: #5a6070;        /* texte secondaire */
  --rule: #d3d4d7;         /* filets, soulignements au repos */
  --accent: #6495ed;       /* CornflowerBlue, la couleur d'effacement par défaut de XNA */

  /* Typographie */
  --font: "Inter Variable", "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --step--1: 0.875rem;                                  /* 14 px */
  --step-0: clamp(1rem, 0.96rem + 0.2vw, 1.125rem);     /* 16 à 18 px */
  --step-1: clamp(1.2rem, 1.06rem + 0.6vw, 1.5rem);     /* 19 à 24 px */
  --step-2: clamp(1.45rem, 1.22rem + 1vw, 2rem);        /* 23 à 32 px */
  --step-3: clamp(2rem, 0.74rem + 3.2vw, 3.25rem);      /* 32 à 52 px : « FontRenderer » tient dans la colonne */
  --step-4: clamp(2.85rem, 1.2rem + 5.6vw, 6.25rem);    /* 46 à 100 px */

  /* Mise en page */
  --max: 1240px;
  --gutter: clamp(20px, 4.5vw, 64px);
  --col-gap: clamp(32px, 4vw, 64px);
  --section-gap: clamp(96px, 11vw, 168px);
}

/* ---------- Base ---------- */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--step-0);
  font-weight: 400;
  font-optical-sizing: auto;
  line-height: 1.55;
  font-kerning: normal;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; }
img, svg, video { display: block; max-width: 100%; }

a {
  color: inherit;
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
  text-decoration-color: var(--rule);
  transition: text-decoration-color 0.15s ease;
}
a:hover { text-decoration-color: currentColor; }

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

::selection { background: color-mix(in srgb, var(--accent) 38%, transparent); }

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

/* Grille asymétrique : une colonne d'étiquettes (4/12), une colonne de contenu (8/12) */
.grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px var(--col-gap);
}
@media (min-width: 900px) {
  .grid { grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); }
}

.skip {
  position: absolute;
  left: 12px;
  top: -80px;
  z-index: 20;
  padding: 10px 14px;
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
}
.skip:focus { top: 12px; }

/* ---------- En-tête ---------- */

.site-header {
  display: flex;
  justify-content: flex-end;
  padding-block: 18px;
}
.site-header nav {
  display: flex;
  gap: clamp(18px, 3vw, 36px);
  font-size: var(--step--1);
}
.site-header a {
  padding-block: 10px;
  color: var(--ink-2);
  text-decoration: none;
}
.site-header a:hover { color: var(--ink); }

/* ---------- Introduction ---------- */

.hero {
  padding-block: clamp(16px, 2.5vw, 32px) clamp(72px, 6vw, 88px);
}

.hero-name {
  font-size: var(--step-4);
  font-weight: 640;
  line-height: 0.95;
  letter-spacing: -0.02em;
  margin-bottom: clamp(24px, 3vw, 44px);
  text-wrap: balance;
}

.hero-role {
  color: var(--ink-2);
  font-size: var(--step--1);
  line-height: 1.5;
  padding-top: 0.45em;
}

.hero-statement {
  font-size: clamp(1.4rem, 1.16rem + 0.9vw, 1.8rem);
  line-height: 1.26;
  letter-spacing: -0.012em;
  max-width: 44ch;
  text-wrap: balance;
}

.hero-availability {
  color: var(--ink-2);
  max-width: 64ch;
  margin-top: 18px;
  text-wrap: pretty;
}

.link-row {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 28px;
  margin-top: 12px;
}
.link-row a {
  display: inline-block;
  padding-block: 8px;
}

/* ---------- Projets ---------- */

.project + .project { margin-top: var(--section-gap); }

.project-head {
  align-items: end;
  margin-bottom: clamp(20px, 3vw, 36px);
}

.project-title {
  font-size: var(--step-3);
  font-weight: 640;
  line-height: 1;
  letter-spacing: -0.018em;
}

.project-sub {
  font-size: var(--step-1);
  line-height: 1.32;
  letter-spacing: -0.008em;
  max-width: 36ch;
  text-wrap: balance;
}

.project-meta {
  color: var(--ink-2);
  font-size: var(--step--1);
  line-height: 1.5;
  display: grid;
  gap: 12px;
  align-content: start;
}
.project-meta a { color: var(--ink); }

.prose { max-width: 62ch; }
.prose > * + * { margin-top: 1em; }
.prose p { text-wrap: pretty; }

/* Listes à tiret demi-cadratin, à la française */
.facts { list-style: none; }
.facts li {
  position: relative;
  padding-left: 1.25em;
}
.facts li + li { margin-top: 0.4em; }
.facts li::before {
  content: "–";
  position: absolute;
  left: 0;
  color: var(--ink-2);
}

/* Visionneuse MiniRT : la même image, trois modes de rendu */
.viewer-stage {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  padding: 0;
  border: 0;
  background: #000;
  overflow: hidden;
  cursor: zoom-in;
}
.layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.22s ease;
}
.layer.is-active { opacity: 1; }

.viewer-bar {
  margin-top: 6px;
  align-items: start;
}

.modes {
  display: flex;
  flex-wrap: wrap;
  gap: 0 22px;
}
.modes button {
  position: relative;
  appearance: none;
  border: 0;
  background: none;
  padding: 12px 0;
  font: inherit;
  font-size: 0.9375rem;
  color: var(--ink-2);
  cursor: pointer;
}
.modes button:hover { color: var(--ink); }
.modes button[aria-pressed="true"] { color: var(--ink); }
.modes button::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 6px;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.22s ease;
}
.modes button[aria-pressed="true"]::after { transform: scaleX(1); }

.viewer-caption {
  color: var(--ink-2);
  font-size: var(--step--1);
  padding-top: 12px;
  max-width: 62ch;
}

.project-body { margin-top: clamp(36px, 5vw, 64px); }

.gallery {
  list-style: none;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 32px 24px;
  margin-top: clamp(48px, 6vw, 88px);
}
@media (min-width: 760px) {
  .gallery { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.zoom {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: #000;
  cursor: zoom-in;
}
.zoom img {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}
.gallery figcaption {
  color: var(--ink-2);
  font-size: var(--step--1);
  line-height: 1.5;
  margin-top: 10px;
  max-width: 44ch;
}

/* Projets à schéma : texte à gauche, figure à droite */
.project-split { row-gap: 40px; }
.project-text { display: grid; gap: 20px; align-content: start; }
.project-text .prose { max-width: 46ch; }

.capture img,
.capture video { width: 100%; height: auto; background: #000; }

/* Powder : les trois états */
.states-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(14px, 3vw, 36px);
}
.state-cell { display: grid; gap: 10px; }
.state { width: 100%; height: auto; overflow: visible; }
.state-box {
  fill: none;
  stroke: var(--ink-2);
  stroke-width: 1.25;
  vector-effect: non-scaling-stroke;
}
.state-dots { fill: var(--ink); }
.state-label { font-size: var(--step--1); }

.states-axis {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 22px;
  color: var(--ink-2);
  font-size: var(--step--1);
}
.axis-line {
  position: relative;
  flex: 1;
  height: 1px;
  background: currentColor;
}
.axis-line::after {
  content: "";
  position: absolute;
  right: 0;
  top: -3.5px;
  width: 8px;
  height: 8px;
  border-top: 1px solid currentColor;
  border-right: 1px solid currentColor;
  transform: rotate(45deg);
  transform-origin: 75% 25%;
}

.states figcaption,
.glyph-figure figcaption {
  color: var(--ink-2);
  font-size: var(--step--1);
  line-height: 1.5;
  margin-top: 14px;
  max-width: 52ch;
}

/* FontRenderer : un glyphe et ses points de contrôle */
.glyph-figure {
  display: grid;
  gap: 8px 40px;
  align-items: end;
}
@media (min-width: 640px) {
  .glyph-figure { grid-template-columns: minmax(0, 300px) minmax(0, 1fr); }
  .glyph-figure figcaption { margin-top: 0; }
}
.glyph { width: 100%; max-width: 260px; height: auto; overflow: visible; }
@media (min-width: 640px) { .glyph { max-width: none; max-height: 340px; } }
.glyph-metric {
  stroke: var(--rule);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}
.glyph-fill {
  fill: var(--ink);
  fill-opacity: 0.07;
  stroke: var(--ink);
  stroke-width: 1.25;
  vector-effect: non-scaling-stroke;
}
.glyph-hull {
  fill: none;
  stroke: var(--ink-2);
  stroke-width: 1;
  stroke-dasharray: 2 4;
  vector-effect: non-scaling-stroke;
}
.glyph-on { fill: var(--ink); }
.glyph-off {
  fill: var(--paper);
  stroke: var(--accent);
  stroke-width: 1.75;
  vector-effect: non-scaling-stroke;
}

/* ---------- Sections ---------- */

.section { margin-top: var(--section-gap); }

.section-title {
  font-size: var(--step-1);
  font-weight: 600;
  line-height: 1.25;
}

.rows { display: grid; gap: clamp(36px, 5vw, 56px); }

.mini h3 {
  font-size: var(--step-2);
  font-weight: 620;
  line-height: 1.15;
  letter-spacing: -0.014em;
}
.mini .meta {
  color: var(--ink-2);
  font-size: var(--step--1);
  margin-top: 6px;
}
.mini p:not(.meta) {
  margin-top: 12px;
  max-width: 62ch;
  text-wrap: pretty;
}
.more { color: var(--ink-2); }

.about-lead {
  font-size: var(--step-1);
  line-height: 1.42;
  letter-spacing: -0.008em;
  max-width: 44ch;
  text-wrap: pretty;
}

.sub { margin-top: clamp(48px, 6vw, 80px); }

.label {
  font-size: var(--step-0);
  font-weight: 600;
  line-height: 1.55;
}

.pairs { list-style: none; display: grid; gap: 18px; }
.pairs > li,
.pairs > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2px 24px;
}
@media (min-width: 600px) {
  .pairs > li,
  .pairs > div { grid-template-columns: 11rem minmax(0, 1fr); }
}
.pair-key {
  color: var(--ink-2);
  font-size: var(--step--1);
  padding-top: 0.2em;
  font-variant-numeric: tabular-nums;
}
.pair-title { font-weight: 600; }
.pairs dd { margin: 0; }

.contact-lead { max-width: 46ch; text-wrap: balance; }
.nowrap { white-space: nowrap; }

.mail {
  display: inline-block;
  margin-top: 18px;
  font-size: clamp(1.5rem, 0.8rem + 3.4vw, 3.6rem);
  font-weight: 620;
  line-height: 1.15;
  letter-spacing: -0.015em;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.14em;
  overflow-wrap: anywhere;
}

/* ---------- Pied de page ---------- */

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  margin-top: var(--section-gap);
  padding-block: 28px 40px;
  color: var(--ink-2);
  font-size: var(--step--1);
}
.site-footer::before {
  content: "";
  flex-basis: 100%;
  height: 1px;
  margin-bottom: 20px;
  background: var(--rule);
}

/* ---------- Visionneuse plein écran ---------- */

html:has(.lightbox[open]) { overflow: hidden; }

.lightbox {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #e6e8ee;
}
.lightbox[open] {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}
.lightbox::backdrop { background: #0c0e14; }
.lightbox :focus-visible { outline: 1px solid #e6e8ee; outline-offset: 0; }

.lightbox button {
  appearance: none;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.lb-close {
  justify-self: end;
  margin: 10px calc(var(--gutter) - 12px) 0 0;
  padding: 12px;
  font-size: var(--step--1);
}
.lb-figure {
  display: grid;
  place-items: center;
  min-height: 0;
  padding: 4px var(--gutter);
}
.lb-img {
  max-width: 100%;
  max-height: 100%;
  max-height: calc(100dvh - 150px);
  width: auto;
  height: auto;
  object-fit: contain;
}
.lb-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px calc(var(--gutter) - 12px) 20px;
  font-size: var(--step--1);
}
.lb-bar button { padding: 12px; }
.lb-bar svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
}
.lb-caption { flex: 1; max-width: 72ch; margin-inline: auto; text-align: center; }
.lb-count { color: rgb(230 232 238 / 0.6); font-variant-numeric: tabular-nums; white-space: nowrap; }

@media (max-width: 599px) {
  .lb-bar { flex-wrap: wrap; justify-content: space-between; }
  .lb-caption { order: -1; flex-basis: 100%; text-align: left; }
}

/* ---------- Préférences ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .layer,
  .modes button::after,
  a { transition: none; }
}
