/* ==========================================================================
   Robin Dehoux — « Rendu progressif »
   Palette: ink / paper / electric blue / cyan. Display: Archivo (wdth+wght).
   ========================================================================== */

/* Self-hosted fonts (SIL OFL, see assets/fonts/OFL-*.txt) — no request to Google. */
@font-face { font-family: "Archivo"; src: url("fonts/archivo-var.woff") format("woff"); font-weight: 100 900; font-stretch: 62% 125%; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("fonts/plexmono-Regular.woff") format("woff"); font-weight: 400; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("fonts/plexmono-Medium.woff") format("woff"); font-weight: 500; font-display: swap; }

:root {
  --ink: #07070a;
  --ink-2: #111116;
  --paper: #efece4;
  --paper-2: #e2ded3;
  --blue: #303aff;           /* a hair lighter than #2b35ff: ink on blue reaches 3:1 */
  --deep: #131a6b;
  --cyan: #39c6ff;

  --display: "Archivo", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --g: clamp(16px, 2.2vw, 32px);          /* gutter */
  --bar-h: 52px;
  --safe-t: env(safe-area-inset-top, 0px);   /* notch, when installed on the iPhone home screen */
  --ease: cubic-bezier(.7, 0, .2, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);

  /* dither masks injected by JS (dither.ts) */
  --ramp-h: none;
  --ramp-v: none;
  color-scheme: dark;
}

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

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }

body {
  background: var(--ink);
  color: var(--paper);
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
html.is-loading body { overflow: hidden; }
.no-js .loader { display: none; }

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
ol, ul { list-style: none; }
::selection { background: var(--blue); color: var(--paper); }

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

.skip {
  position: fixed; left: 12px; top: 12px; z-index: 200;
  padding: 10px 14px; background: var(--blue); color: var(--paper);
  font-size: 12px; text-transform: uppercase; letter-spacing: .05em;
  transform: translateY(-160%);
}
.skip:focus, .skip:focus-visible { transform: none; outline-color: var(--paper); }

@media (pointer: fine) {
  html.has-cursor, html.has-cursor * { cursor: none !important; }
}

/* ---------- Field canvas (fixed, behind everything) ---------- */
.field {
  position: fixed; inset: 0;
  width: 100vw; height: 100vh;
  z-index: 0;
  display: block;
  background: var(--ink);
  image-rendering: pixelated;
}

main { position: relative; z-index: 1; }

/* ---------- Loader ---------- */
.loader { position: fixed; inset: 0; z-index: 100; pointer-events: none; }
.loader__grid { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.loader__ui {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: var(--g);
  text-transform: uppercase; font-size: 12px; letter-spacing: .04em;
}
.loader__row { display: flex; justify-content: space-between; gap: 16px; }
.loader__count {
  font-family: var(--display); font-weight: 900; font-stretch: 125%;
  font-size: clamp(5rem, 22vw, 22rem); line-height: .8;
  font-variant-numeric: tabular-nums; letter-spacing: -.03em;
  display: flex; align-items: flex-start;
}
.loader__count small { font-size: .22em; font-stretch: 100%; margin: .2em 0 0 .1em; color: var(--cyan); }
.loader.is-done { display: none; }

/* ---------- Custom pixel cursor ---------- */
.cursor {
  position: fixed; left: 0; top: 0; z-index: 90;
  width: 12px; height: 12px;
  pointer-events: none;
  color: var(--paper);
  opacity: 0;
  transition: width .35s var(--ease-out), height .35s var(--ease-out), opacity .2s;
}
.cursor::before {
  content: ""; position: absolute; inset: 0;
  background: currentColor;
  transition: background .2s, box-shadow .2s;
}
.cursor[data-theme="light"] { color: var(--ink); }
.cursor[data-theme="blue"] { color: var(--paper); }
.cursor.is-hover { width: 64px; height: 64px; }
.cursor.is-hover::before { background: transparent; box-shadow: inset 0 0 0 2px currentColor; }
.cursor__label {
  position: absolute; left: 100%; top: 100%; margin: 6px 0 0 6px;
  white-space: nowrap; font-size: 11px; text-transform: uppercase; letter-spacing: .04em;
  color: currentColor; opacity: 0; transition: opacity .2s;
}
.cursor.is-hover .cursor__label { opacity: 1; }
.cursor.is-on { opacity: 1; }

.xhair-on .cursor:not(.is-hover) { opacity: 0 !important; }

/* ---------- Hero technical plan (rigid layer over the living surface) ---------- */
.plan {
  position: absolute; inset: 0; pointer-events: none; overflow: hidden;
  opacity: 0; transition: opacity .6s;
  color: rgba(239,236,228,.8);
  font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; line-height: 1.2;
}
.plan.is-on { opacity: 1; }
.dim { --p: 1; position: absolute; }
.dim span { position: absolute; background: var(--ink); padding: 2px 6px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.dim--h { height: 11px; border-left: 1px solid currentColor; border-right: 1px solid currentColor; transform: scaleX(var(--p)); transform-origin: left center; }
.dim--h::before { content: ""; position: absolute; left: 0; right: 0; top: 5px; border-top: 1px solid currentColor; }
.dim--h span { left: 50%; top: 5px; transform: translate(-50%, -50%); }
.dim--v { width: 11px; border-top: 1px solid currentColor; border-bottom: 1px solid currentColor; transform: scaleY(var(--p)); transform-origin: center top; }
.dim--v::before { content: ""; position: absolute; top: 0; bottom: 0; left: 5px; border-left: 1px solid currentColor; }
.dim--v span { left: 5px; top: 50%; transform: translate(-50%, -50%) rotate(-90deg); }
.plan__cap { position: absolute; white-space: pre; opacity: var(--p, 1); }
.reg { position: absolute; width: 15px; height: 15px; margin: -7px 0 0 -7px; opacity: var(--p, 1); }
.reg::before, .reg::after { content: ""; position: absolute; background: currentColor; }
.reg::before { left: 7px; top: 0; bottom: 0; width: 1px; }
.reg::after { top: 7px; left: 0; right: 0; height: 1px; }

/* ---------- CAD crosshair (hero, desktop) ---------- */
.xhair { position: fixed; inset: 0; z-index: 5; pointer-events: none; opacity: 0; transition: opacity .3s; color: rgba(239,236,228,.38); }
.xhair.is-on { opacity: 1; }
.xhair i { position: absolute; display: block; }
.xhair__h { left: 0; right: 0; top: 0; height: 1px; background: currentColor; transform: translateY(var(--y)); }
.xhair__v { top: 0; bottom: 0; left: 0; width: 1px; background: currentColor; transform: translateX(var(--x)); }
.xhair__box { left: 0; top: 0; width: 17px; height: 17px; margin: -8px 0 0 -8px; border: 1px solid var(--paper); background: var(--ink); transform: translate(var(--x), var(--y)); }
.xhair__read {
  position: absolute; left: 0; top: 0; white-space: pre;
  transform: translate(calc(var(--x) + 18px), calc(var(--y) + 14px));
  font-size: 10.5px; letter-spacing: .06em; color: var(--paper); font-variant-numeric: tabular-nums;
  background: var(--ink); padding: 2px 6px;
}

/* ---------- Top bar ---------- */
.bar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 70;
  height: calc(var(--bar-h) + var(--safe-t));
  padding: 0 var(--g);
  padding-top: var(--safe-t);
  display: grid;
  grid-template-columns: 1.2fr 1.4fr 1fr auto auto;
  align-items: center; gap: 24px;
  font-size: 12px; text-transform: uppercase; letter-spacing: .04em;
  color: var(--bar-fg, var(--paper));
  transition: color .35s;
}
.bar[data-theme="light"] { --bar-fg: var(--ink); }
.bar__name { font-weight: 500; }
.bar__clock { display: inline-flex; align-items: center; gap: 8px; font-variant-numeric: tabular-nums; }
.bar__clock .dot { width: 6px; height: 6px; background: currentColor; animation: blink 1s steps(1) infinite; }
.bar__render { font-variant-numeric: tabular-nums; }
.bar__menu {
  text-transform: uppercase; letter-spacing: .04em; font-size: 12px;
  padding: 8px 14px; margin-right: -14px;
  position: relative;
}
.bar__menu::before { content: "["; margin-right: 6px; }
.bar__menu::after { content: "]"; margin-left: 6px; }
@keyframes blink { 50% { opacity: 0; } }

/* ---------- Menu ---------- */
.menu {
  position: fixed; inset: 0; z-index: 60;
  background: var(--blue); color: var(--paper);
  display: flex; flex-direction: column; justify-content: space-between;
  padding: calc(var(--bar-h) + var(--safe-t) + 4vh) var(--g) var(--g);
  visibility: hidden;
  -webkit-mask-size: 48px 48px; mask-size: 48px 48px;
}
.menu.is-open { visibility: visible; }
.menu__list { counter-reset: m; }
.menu__list a {
  display: flex; align-items: baseline; gap: 2vw;
  font-family: var(--display); font-weight: 800;
  /* sized by height AND width: the longest label ("Anor Studio") always fits on one line */
  font-size: clamp(2rem, min(8.8vh, 9.4vw), 8.5rem); line-height: .96;
  font-stretch: 75%; text-transform: uppercase; letter-spacing: -.01em; white-space: nowrap;
  transition: font-stretch .5s var(--ease-out), color .2s, padding .5s var(--ease-out);
}
.menu__list a small { flex: none; font-family: var(--mono); font-size: 12px; font-weight: 400; width: 2.4em; letter-spacing: 0; }
.menu__list a span { min-width: 0; }
.menu__list a:focus-visible { color: var(--ink); }
@media (hover: hover) {
  .menu__list a:hover, .menu__list a:focus-visible { font-stretch: 125%; color: var(--ink); }
}
@media (hover: none) {
  .menu__list a:active { color: var(--ink); }
}
.menu__foot { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; text-transform: uppercase; font-size: 12px; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  height: 100vh; height: 100svh;
  min-height: 520px;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: calc(var(--bar-h) + var(--safe-t) + 8px) var(--g) var(--g);
  pointer-events: none;
}
.hero a { pointer-events: auto; }
.hero__title {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
.no-gl .hero__title {
  position: absolute; width: auto; height: auto; overflow: visible; clip: auto; white-space: normal;
  left: var(--g); right: var(--g); top: 22%;
  font-family: var(--display); font-weight: 900; font-stretch: 125%;
  font-size: clamp(4rem, 17vw, 20rem); line-height: .82; text-transform: uppercase; letter-spacing: -.03em;
}
.no-gl .hero__title span { display: block; }
.no-gl .field {
  background:
    radial-gradient(circle at 30% 40%, var(--blue) 0 1.5px, transparent 2px) 0 0 / 7px 7px,
    radial-gradient(120% 90% at 50% 0%, var(--blue), var(--deep) 45%, var(--ink) 80%);
}

.hero__coords {
  display: flex; justify-content: space-between;
  font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: rgba(239,236,228,.7);
}
.hero__foot {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px;
  font-size: 12px; line-height: 1.45; text-transform: uppercase; letter-spacing: .02em;
}
.hero__cell { max-width: 30ch; }
.hero__cell .k { display: block; color: var(--cyan); margin-bottom: 6px; }
.hero__hint { justify-self: end; text-align: right; display: flex; flex-direction: column; align-items: flex-end; }
.hero__down { margin-top: 14px; display: inline-block; border-bottom: 1px solid currentColor; padding-bottom: 2px; }

[data-intro] { opacity: 0; }
.no-js [data-intro], .is-ready [data-intro] { opacity: 1; }

/* ---------- Sections (generic) ---------- */
.sec {
  position: relative;
  padding: clamp(80px, 12vw, 180px) var(--g) clamp(80px, 10vw, 160px);
  background: var(--sec-bg);
  color: var(--sec-fg);
}
/* dithered edge: each opaque section bleeds into the previous one in pixels */
.sec::before {
  content: ""; position: absolute; left: 0; right: 0; top: -47px; height: 48px;
  background: var(--sec-bg);
  -webkit-mask-image: var(--ramp-v); mask-image: var(--ramp-v);
  -webkit-mask-size: 48px 48px; mask-size: 48px 48px;
  -webkit-mask-repeat: repeat-x; mask-repeat: repeat-x;
  pointer-events: none;
}
.sec--paper { --sec-bg: var(--paper); --sec-fg: var(--ink); --sec-dim: rgba(7,7,10,.66); --sec-line: rgba(7,7,10,.18); }
.sec--ink   { --sec-bg: var(--ink);   --sec-fg: var(--paper); --sec-dim: rgba(239,236,228,.62); --sec-line: rgba(239,236,228,.16); }
.sec--blue  { --sec-bg: var(--blue);  --sec-fg: var(--paper); --sec-dim: rgba(239,236,228,.9); --sec-line: rgba(239,236,228,.3); }

/* dithered wipe reveal (driven by --x, see reveal.ts) */
.wipe {
  --x: -200px;
  -webkit-mask-image: linear-gradient(#000, #000), var(--ramp-h);
  mask-image: linear-gradient(#000, #000), var(--ramp-h);
  -webkit-mask-size: max(0px, var(--x)) 100%, 192px 48px;
  mask-size: max(0px, var(--x)) 100%, 192px 48px;
  -webkit-mask-position: 0 0, var(--x) 0;
  mask-position: 0 0, var(--x) 0;
  -webkit-mask-repeat: no-repeat, repeat-y;
  mask-repeat: no-repeat, repeat-y;
}
.wipe.is-in { -webkit-mask-image: none; mask-image: none; }

/* ---------- 01 Profil ---------- */
.statement {
  font-family: var(--display); font-weight: 800; font-stretch: 88%;
  font-size: clamp(2.6rem, 5.8vw, 6.8rem); line-height: .92; letter-spacing: -.025em;
  text-transform: uppercase;
  max-width: 15ch;
}
.statement .w { display: inline-block; opacity: .12; transition: opacity .12s linear; }
.profil__grid {
  display: grid; grid-template-columns: repeat(12, 1fr); gap: var(--g);
  margin-top: clamp(64px, 9vw, 140px);
}
.profil__text { grid-column: 4 / span 5; font-size: clamp(15px, 1.25vw, 18px); line-height: 1.55; }
.fiche { grid-column: 9 / span 4; border-top: 1px solid var(--sec-line); }
.fiche div { display: grid; grid-template-columns: 1fr 1.6fr; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--sec-line); font-size: 13px; }
.fiche dt { text-transform: uppercase; color: var(--sec-dim); font-size: 11px; letter-spacing: .05em; padding-top: 2px; }

/* ---------- 02 Formation ---------- */
.formation__degree {
  font-family: var(--display); font-weight: 600; font-stretch: 100%;
  font-size: clamp(1.3rem, 2vw, 2rem); line-height: 1.05; text-transform: uppercase; letter-spacing: -.01em;
  max-width: 24ch;
}
.formation__degree span { display: block; margin-top: 10px; font-family: var(--mono); font-weight: 400; font-size: 12px; letter-spacing: .05em; color: var(--sec-dim); }
.mention {
  --w: 62;
  margin: clamp(40px, 6vw, 90px) 0;
  font-family: var(--display); font-weight: 900; font-stretch: calc(var(--w) * 1%);
  font-size: clamp(3.2rem, 7.6vw, 11rem); line-height: .82; letter-spacing: -.02em;
  text-transform: uppercase; white-space: nowrap;
}
.mention span { display: block; }
.mention span:last-child { color: var(--ink); }
.formation__row { display: grid; grid-template-columns: repeat(12, 1fr); gap: var(--g); align-items: start; }
.jury {
  grid-column: 1 / span 6;
  font-family: var(--display); font-weight: 700; font-stretch: 100%;
  font-size: clamp(1.3rem, 1.9vw, 1.9rem); line-height: 1.05; text-transform: uppercase;
  display: flex; gap: 16px; max-width: 22ch;
}
.jury__mark { color: var(--cyan); }
.disciplines { grid-column: 8 / span 5; columns: 2; column-gap: var(--g); counter-reset: d; font-size: 13px; text-transform: uppercase; letter-spacing: .03em; }
.disciplines li { counter-increment: d; padding: 8px 0; border-top: 1px solid var(--sec-line); break-inside: avoid; }
.disciplines li::before { content: counter(d, decimal-leading-zero) "  "; color: var(--sec-dim); white-space: pre; }

/* ---------- 03 Parcours ---------- */
.log { border-top: 1px solid var(--sec-line); }
.log__row {
  display: grid; grid-template-columns: repeat(12, 1fr); gap: var(--g);
  padding: clamp(24px, 3vw, 44px) 0;
  border-bottom: 1px solid var(--sec-line);
  align-items: start;
}
.log__year {
  grid-column: 1 / span 5;
  font-family: var(--display); font-weight: 900; font-stretch: 112%;
  font-size: clamp(4rem, 8vw, 9rem); line-height: .78; letter-spacing: -.04em;
  text-transform: uppercase;
  transition: color .3s, font-stretch .6s var(--ease-out);
}
.log__row:hover .log__year { color: var(--blue); font-stretch: 125%; }
.log__body { grid-column: 7 / span 6; max-width: 56ch; }
.log__body h3 {
  font-family: var(--display); font-weight: 700; font-stretch: 100%;
  font-size: clamp(1.15rem, 1.5vw, 1.5rem); line-height: 1.05; text-transform: uppercase; letter-spacing: -.01em;
}
.log__body h3 em { font-family: var(--mono); font-style: normal; font-weight: 400; font-size: 11px; vertical-align: middle; padding: 2px 6px; margin-left: 6px; background: var(--ink); color: var(--paper); letter-spacing: .05em; white-space: nowrap; display: inline-block; line-height: 1.4; }
.log__org { margin: 8px 0 14px; color: var(--blue); text-transform: uppercase; font-size: 12px; letter-spacing: .04em; }
.log__body p:last-child { font-size: 14px; line-height: 1.6; }

/* ---------- 04 Projets ---------- */
.works { border-top: 1px solid var(--sec-line); }
.work {
  display: grid; grid-template-columns: 4em 1fr 14em 4em; gap: var(--g); align-items: baseline;
  padding: clamp(14px, 1.6vw, 22px) 0;
  border-bottom: 1px solid var(--sec-line);
  position: relative;
  transition: color .25s, padding .5s var(--ease-out);
}
.work__n, .work__c, .work__y { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--sec-dim); transition: color .25s; }
.work__y { text-align: right; }
.work__t {
  font-family: var(--display); font-weight: 800; font-stretch: 78%;
  font-size: clamp(1.9rem, 3.6vw, 4rem); line-height: .95; text-transform: uppercase; letter-spacing: -.015em;
  transition: font-stretch .6s var(--ease-out), color .25s;
}
.works:hover .work { color: rgba(239,236,228,.28); }
.works:hover .work:hover, .work:focus-visible { color: var(--paper); }
.work:hover .work__t, .work:focus-visible .work__t { font-stretch: 112%; color: var(--cyan); }
.work:hover .work__n, .work:hover .work__c, .work:hover .work__y { color: var(--paper); }

.all {
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  margin-top: clamp(32px, 4vw, 56px);
  padding: 22px 24px;
  background: var(--paper); color: var(--ink);
  font-size: 13px; text-transform: uppercase; letter-spacing: .04em;
  transition: background .25s, color .25s;
}
.all:hover { background: var(--blue); color: var(--paper); }

.peek {
  position: fixed; left: 0; top: 0; z-index: 40;
  width: clamp(260px, 24vw, 380px); aspect-ratio: 3 / 2;
  pointer-events: none; opacity: 0;
  transition: opacity .25s;
  will-change: transform;
}
.peek.is-on { opacity: 1; }
.peek canvas { width: 100%; height: 100%; display: block; image-rendering: pixelated; }
.peek__label {
  position: absolute; left: 0; bottom: 0; transform: translateY(100%);
  padding: 6px 8px; background: var(--paper); color: var(--ink);
  font-size: 11px; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap;
}

/* ---------- 05 Services ---------- */
.svc__head { display: grid; grid-template-columns: repeat(12, 1fr); gap: var(--g); align-items: end; margin-bottom: clamp(48px, 6vw, 96px); }
.svc__title {
  grid-column: 1 / span 7;
  font-family: var(--display); font-weight: 900; font-stretch: 125%;
  font-size: clamp(3.2rem, 7.4vw, 9.5rem); line-height: .8; letter-spacing: -.045em; text-transform: uppercase;
  white-space: nowrap;
}
.svc__intro { grid-column: 8 / span 5; font-size: clamp(15px, 1.2vw, 17px); line-height: 1.55; max-width: 44ch; }
.svc__list {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--sec-line);
  counter-reset: none;
}
.svc__item {
  position: relative; display: flex; flex-direction: column; min-width: 0;
  padding: 22px var(--g) 30px 0;
  border-bottom: 1px solid var(--sec-line);
}
.svc__item + .svc__item { padding-left: var(--g); border-left: 1px solid var(--sec-line); }
.svc__item:nth-child(3n + 1) { padding-left: 0; border-left: 0; }
.svc__n { font-size: 11px; letter-spacing: .06em; color: var(--sec-dim); }
.svc__t {
  margin: 44px 0 18px;
  font-family: var(--display); font-weight: 800; font-stretch: 78%;
  font-size: clamp(1.7rem, 2.5vw, 2.9rem); line-height: .95; text-transform: uppercase; letter-spacing: -.015em;
  overflow-wrap: break-word; hyphens: manual;
  transition: font-stretch .6s var(--ease-out);
}
.svc__d { font-size: 14px; line-height: 1.55; color: var(--sec-dim); }
.svc__deliv { margin: 20px 0 22px; border-top: 1px solid var(--sec-line); }
.svc__deliv li {
  display: flex; gap: 10px; align-items: baseline;
  padding: 7px 0; border-bottom: 1px solid var(--sec-line);
  font-size: 12px; text-transform: uppercase; letter-spacing: .03em;
}
.svc__deliv li::before { content: ""; flex: none; width: 6px; height: 6px; background: currentColor; transform: translateY(-1px); }
.svc__tools { margin-top: auto; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--sec-dim); }
.svc__link {
  align-self: flex-start; margin-top: 14px;
  font-size: 12px; text-transform: uppercase; letter-spacing: .04em;
  border-bottom: 1px solid currentColor; padding-bottom: 2px;
}
.svc__cta {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px 32px;
  margin-top: clamp(48px, 6vw, 88px);
}
.svc__cta p {
  font-family: var(--display); font-weight: 800; font-stretch: 100%;
  font-size: clamp(1.4rem, 2.6vw, 2.6rem); line-height: 1; text-transform: uppercase; letter-spacing: -.02em;
  max-width: 24ch;
}
.svc__btn {
  display: inline-block; padding: 16px 22px; background: var(--paper); color: var(--ink);
  text-transform: uppercase; font-size: 13px; letter-spacing: .04em;
  transition: background .25s, color .25s;
}
.svc__btn:hover, .svc__btn:focus-visible { background: var(--ink); color: var(--paper); }
@media (hover: hover) {
  .svc__item:hover .svc__t { font-stretch: 112%; }
  .svc__item:hover .svc__n { color: var(--paper); }
  .svc__link:hover { color: var(--cyan); }
}
@media (max-width: 1100px) {
  .svc__list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .svc__item:nth-child(3n + 1) { padding-left: var(--g); border-left: 1px solid var(--sec-line); }
  .svc__item:nth-child(2n + 1) { padding-left: 0; border-left: 0; }
  .svc__title { grid-column: 1 / -1; }
  .svc__intro { grid-column: 1 / span 8; }
}
@media (max-width: 760px) {
  .svc__head { grid-template-columns: minmax(0, 1fr); }
  .svc__title, .svc__intro { grid-column: 1 / -1; }
  .svc__title { font-size: min(13.5vw, 6rem); }
  .svc__list { grid-template-columns: 1fr; }
  .svc__item, .svc__item + .svc__item, .svc__item:nth-child(n) { padding: 20px 0 26px; border-left: 0; }
  .svc__t { margin: 22px 0 14px; font-size: clamp(1.8rem, 9vw, 2.6rem); }
  .svc__btn { width: 100%; text-align: center; }
}

/* ---------- 06 Anor ---------- */
.anor__grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: var(--g); align-items: end; }
.anor__name {
  grid-column: 1 / span 8;
  font-family: var(--display); font-weight: 900; font-stretch: 125%;
  font-size: clamp(3.2rem, 7.4vw, 9.5rem); line-height: .8; letter-spacing: -.045em; text-transform: uppercase;
  white-space: nowrap;
}
.anor__swatch { grid-column: 9 / span 4; grid-row: 1; align-self: start; aspect-ratio: 1; background: var(--ink); }
.anor__swatch canvas { width: 100%; height: 100%; display: block; image-rendering: pixelated; }
.anor__text { grid-column: 8 / span 5; font-size: clamp(15px, 1.2vw, 17px); line-height: 1.55; }
.services { margin: 28px 0 32px; border-top: 1px solid var(--sec-line); }
.services li {
  display: flex; gap: 16px; align-items: baseline; padding: 10px 0; border-bottom: 1px solid var(--sec-line);
  font-family: var(--display); font-weight: 700; font-size: clamp(1.05rem, 1.35vw, 1.3rem); text-transform: uppercase; font-stretch: 100%;
}

.anor__link {
  display: inline-block; padding: 16px 22px; background: var(--ink); color: var(--paper);
  text-transform: uppercase; font-size: 13px; letter-spacing: .04em;
  transition: background .25s;
}
.anor__link:hover { background: var(--blue); }

/* ---------- 07 Outils ---------- */
.tools { border-top: 1px solid var(--sec-line); }
.tool {
  --wd: 75; --wg: 400;
  display: flex; justify-content: space-between; align-items: baseline; gap: 16px;
  padding: 6px 0; border-bottom: 1px solid var(--sec-line);
}
.tool[data-level="3"] { --wd: 125; --wg: 900; }
.tool[data-level="2"] { --wd: 100; --wg: 650; }
.tool[data-level="1"] { --wd: 72; --wg: 380; }
.tool__name {
  font-family: var(--display);
  font-weight: var(--wg); font-stretch: calc(var(--wd) * 1%);
  font-size: clamp(2.6rem, 6.8vw, 8rem); line-height: .95; letter-spacing: -.02em; text-transform: uppercase;
  transition: font-weight .7s var(--ease-out), font-stretch .7s var(--ease-out), color .25s;
}
.tool__lvl { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--sec-dim); white-space: nowrap; }
.tool[data-level="3"] .tool__lvl { color: var(--cyan); }
.tools:hover .tool__name { color: rgba(239,236,228,.3); }
.tools .tool:hover .tool__name { color: var(--paper); }
.extras { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--g); margin-top: clamp(48px, 6vw, 90px); }
.extras dl { border-top: 1px solid var(--sec-line); padding-top: 12px; }
.extras dt { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--sec-dim); margin-bottom: 8px; }
.extras dd { font-size: 14px; text-transform: uppercase; }

/* ---------- 07 Contact ---------- */
.contact { position: relative; }
.contact__stage {
  position: relative;
  height: 100vh; height: 100svh; min-height: 520px;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: var(--g) var(--g) calc(var(--g) + 64px);
  pointer-events: none;
}
.contact__title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.no-gl .contact__title {
  position: static; width: auto; height: auto; overflow: visible; clip: auto; white-space: normal;
  font-family: var(--display); font-weight: 900; font-stretch: 125%;
  font-size: clamp(4rem, 16vw, 18rem); line-height: .85; text-transform: uppercase; margin-bottom: auto; margin-top: 20vh;
}
.contact__meta { display: flex; justify-content: space-between; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }
.contact__panel { padding-top: clamp(56px, 7vw, 100px); }
.links { border-top: 1px solid var(--sec-line); }
.links li { display: flex; align-items: center; gap: 16px; border-bottom: 1px solid var(--sec-line); }
.links a {
  flex: 1; min-width: 0;
  display: grid; grid-template-columns: 9em 1fr; align-items: baseline; gap: var(--g);
  padding: clamp(14px, 1.8vw, 26px) 0;
  transition: color .25s;
}
.links small { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--sec-dim); }
.links span {
  font-family: var(--display); font-weight: 800; font-stretch: 85%;
  font-size: clamp(1.5rem, 3.4vw, 3.8rem); line-height: 1; text-transform: uppercase; letter-spacing: -.02em;
  overflow-wrap: anywhere;
  transition: font-stretch .6s var(--ease-out);
}
.links a:hover span { font-stretch: 110%; color: var(--cyan); }
.copy {
  font-size: 11px; text-transform: uppercase; letter-spacing: .05em;
  padding: 8px 12px; border: 1px solid var(--sec-line);
  transition: background .2s, color .2s;
}
.copy:hover { background: var(--paper); color: var(--ink); }
.foot {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px;
  margin-top: clamp(56px, 8vw, 120px);
  font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--sec-dim);
}
.foot a { color: var(--paper); }


/* ==========================================================================
   Section transitions: one language (resolution / density), several rhythms
   ========================================================================== */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* hero → profil: the render cools down in big, sparse pixels */
.sec--melt::before {
  top: -159px; height: 160px;
  -webkit-mask-image: var(--ramp-melt); mask-image: var(--ramp-melt);
  -webkit-mask-size: 128px 160px; mask-size: 128px 160px;
}
.profil { padding-bottom: max(280px, 22vw); }

/* profil → formation: blue rains into the paper as you scroll */
.sec--flood::before { display: none; }
.flood {
  /* -1px: overlaps the section by one pixel so no hairline seam shows while scrolling */
  position: absolute; left: 0; right: 0; bottom: calc(100% - 1px); height: 240px;
  background: var(--blue); pointer-events: none;
  /* one sprite holding every frame; scroll only moves it (see interface.ts) */
  -webkit-mask-image: var(--flood-img, none); mask-image: var(--flood-img, none);
  -webkit-mask-size: 96px var(--flood-h, 240px); mask-size: 96px var(--flood-h, 240px);
  -webkit-mask-repeat: repeat-x; mask-repeat: repeat-x;
  -webkit-mask-position: 0 var(--flood-y, 0px); mask-position: 0 var(--flood-y, 0px);
  transform: translateZ(0);
}
.formation { padding-top: clamp(56px, 8vw, 120px); }

/* formation → parcours: a hard cut. Silence after the blue. */
.sec--cut::before { display: none; }
.side-label {
  position: absolute; top: clamp(80px, 12vw, 180px); right: calc(var(--g) * .5);
  writing-mode: vertical-rl; transform: rotate(180deg);
  font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--sec-dim);
}
.parcours .log { border-top: 0; margin-right: 28px; }
.parcours { padding-bottom: clamp(140px, 16vw, 260px); }

/* parcours → projets: the title straddles paper and ink */
.projets {
  --st: min(21rem, calc((100vw - 2 * var(--g) - 4vw) / 5.95));
  padding-top: calc(var(--st) * .45 + clamp(56px, 6.5vw, 120px));
}
.straddle {
  position: absolute; left: 0; right: 0; top: 0; z-index: 2;
  transform: translateY(-52%);
  font-family: var(--display); font-weight: 900; font-stretch: 125%;
  /* sized so the whole word (≈5.85em) always fits, sliding ±2vw included */
  font-size: var(--st); line-height: .78; letter-spacing: -.05em; text-transform: uppercase;
  color: var(--paper); mix-blend-mode: difference;
  white-space: nowrap; pointer-events: none; overflow: hidden;
  padding: .04em 0;
}
.straddle span { display: inline-block; padding-left: var(--g); will-change: transform; }

/* projets → anor: the resolution drops for one beat */
.sec--lowres::before {
  top: -95px; height: 96px;
  -webkit-mask-image: var(--ramp-low); mask-image: var(--ramp-low);
  -webkit-mask-size: 192px 96px; mask-size: 192px 96px;
}
.anor__fallback { width: 62%; margin: 19% auto; display: block; }

/* outils: dense, no chrome */
.outils .tools { border-top: 0; }
.tools__note { margin-top: 18px; font-size: 13px; color: var(--sec-dim); max-width: 40ch; }

/* project peek: a printed proof, not a card */
.peek { width: clamp(300px, 27vw, 440px); aspect-ratio: 4 / 3; opacity: 1; transition: none; }
.peek canvas { background: transparent; }
.peek__label { opacity: 0; transition: opacity .25s; }
.peek.is-on .peek__label { opacity: 1; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1100px) {
  /* phone & tablet: the hero is only the name and the surface */
  .hero__foot, .plan { display: none; }
  .bar { grid-template-columns: 1fr auto auto; }
  .bar__role, .bar__render { display: none; }
  .profil__text { grid-column: 1 / span 7; }
  .fiche { grid-column: 8 / span 5; }
  .work { grid-template-columns: 3em 1fr 4em; }
  .work__c { display: none; }
}

@media (max-width: 760px) {
  :root { --bar-h: 48px; }
  .bar { grid-template-columns: 1fr auto; gap: 12px; }
  .bar__clock { display: none; }
  .bar__menu { margin-right: -8px; }

  .menu { padding-top: calc(var(--bar-h) + var(--safe-t) + 3vh); }
  .menu__list { margin-block: auto; }
  .menu__list a { font-size: min(8.4vh, 13vw); line-height: 1; gap: 10px; }
  .menu__list a small { width: 2em; font-size: 11px; }
  .menu__foot { padding-bottom: env(safe-area-inset-bottom, 0px); }

  .hero__foot { grid-template-columns: 1fr 1fr; gap: 18px 16px; font-size: 11px; }
  .hero__cell:nth-child(3) { display: none; }
  .hero__hint { grid-column: 1 / -1; justify-self: stretch; text-align: left; align-items: flex-start; }
  .hero__down { margin-top: 10px; }
  .hero__coords span:last-child { display: none; }
  .plan { font-size: 9.5px; }

  .statement { font-size: clamp(2.3rem, 11.5vw, 4rem); }
  .profil__grid, .formation__row, .anor__grid { grid-template-columns: 1fr; }
  .profil__text, .fiche, .jury, .disciplines, .anor__name, .anor__text, .anor__swatch { grid-column: 1 / -1; }
  .anor__swatch { grid-row: auto; width: 56%; justify-self: end; }
  .jury { margin-bottom: 32px; }
  .mention { font-size: min(10.6vw, 5rem); }

  .log__row { grid-template-columns: 1fr; gap: 14px; }
  .log__year, .log__body { grid-column: 1 / -1; }
  .log__year { font-size: clamp(4.2rem, 24vw, 7rem); }

  .work { grid-template-columns: 2.4em 1fr; gap: 12px; }
  .work__y { display: none; }
  .work__c { display: block; grid-column: 2; margin-top: -4px; }
  .work__t { font-size: clamp(1.7rem, 8.4vw, 3rem); }
  .peek { display: none; }

  .tool { flex-direction: column; gap: 0; padding: 10px 0; }
  .tool__name { font-size: clamp(2.4rem, 13vw, 4.6rem); }
  .extras { grid-template-columns: 1fr 1fr; }

  .links a { grid-template-columns: 1fr; gap: 6px; }
  .links li { flex-wrap: wrap; }
  .links span { font-size: clamp(1.1rem, 5.6vw, 2.4rem); font-stretch: 72%; }
  .copy { margin-bottom: 14px; }
  .sec::before { top: -35px; height: 36px; -webkit-mask-size: 36px 36px; mask-size: 36px 36px; }
  .sec--melt::before { top: -95px; height: 96px; -webkit-mask-size: 80px 100px; mask-size: 80px 100px; }
  .sec--lowres::before { top: -63px; height: 64px; -webkit-mask-size: 128px 64px; mask-size: 128px 64px; }
  .side-label { display: none; }
  .parcours .log { margin-right: 0; }
}

/* Touch screens: no hover peek, so each project shows its own small blue print */
.work__thumb { display: none; }
@media (hover: none) {
  .work { grid-template-columns: 2.6em minmax(0, 1fr) clamp(96px, 26vw, 220px); align-items: center; }
  .work__y { display: none; }
  .work__c { grid-column: 2; }
  /* the title shares the row with the thumbnail: size it on the space left
     so the longest word (« SolidWorks », « Impression ») never runs under the image */
  .work__t { font-size: min(3rem, calc((74vw - 4 * var(--g) - 38px) / 6)); min-width: 0; hyphens: auto; }
  .work__thumb {
    display: block; grid-column: 3; grid-row: 1 / span 2; position: relative;
    aspect-ratio: 4 / 3; background: var(--blue); overflow: hidden;
  }
  .work__thumb img {
    width: 100%; height: 100%; object-fit: cover; display: block;
    filter: grayscale(1) contrast(1.2) brightness(1.15); mix-blend-mode: multiply;
  }
  .work__thumb::after {
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background: radial-gradient(circle, rgba(239,236,228,.35) 0.9px, transparent 1.3px) 0 0 / 4px 4px;
    mix-blend-mode: screen;
  }
}

/* Touch: no hover-dim on lists */
@media (hover: none) {
  .works:hover .work, .tools:hover .tool__name { color: inherit; }
}


/* ==========================================================================
   Project pages
   ========================================================================== */
.page-projet { background: var(--paper); color: var(--ink); }
.bar--page {
  --bar-fg: var(--ink);
  background: var(--paper); color: var(--ink);
  grid-template-columns: 1.2fr 1.4fr 1fr auto;
  border-bottom: 1px solid rgba(7,7,10,.12);
}
.bar__back { justify-self: end; }
.bar__back:hover { color: var(--blue); }
.projet { padding-top: calc(var(--bar-h) + var(--safe-t)); }
.projet__head {
  padding: clamp(56px, 9vw, 140px) var(--g) clamp(28px, 4vw, 56px);
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px 32px; align-items: end;
}
.projet__meta { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: rgba(7,7,10,.66); }
.projet__meta span + span::before { content: "·"; margin-right: 18px; }
.projet__title {
  font-family: var(--display); font-weight: 900; font-stretch: 125%;
  font-size: clamp(3rem, 8vw, 8.5rem); line-height: .84; letter-spacing: -.04em;
  text-transform: uppercase; text-wrap: balance; overflow-wrap: anywhere;
}
.projet__index { font-size: 12px; letter-spacing: .05em; font-variant-numeric: tabular-nums; padding-bottom: .6em; }

.projet__about {
  padding: 0 var(--g) clamp(48px, 7vw, 110px);
  display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) minmax(200px, .7fr); gap: 24px clamp(24px, 4vw, 64px);
  align-items: start; border-top: 1px solid rgba(7,7,10,.12); padding-top: clamp(24px, 3vw, 40px);
}
.projet__lead { font-family: var(--display); font-weight: 500; font-stretch: 88%; font-size: clamp(1.3rem, 2.1vw, 2rem); line-height: 1.15; letter-spacing: -.01em; max-width: 30ch; }
.projet__body { font-size: 14px; line-height: 1.6; max-width: 52ch; color: rgba(7,7,10,.82); }
.projet__fiche { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; font-size: 12px; margin: 0; }
.projet__fiche dt { text-transform: uppercase; letter-spacing: .05em; color: rgba(7,7,10,.66); }
.projet__fiche dd { margin: 0; }

.cover {
  position: relative; margin: 0 auto;
  aspect-ratio: var(--ar);
  width: min(calc(100% - 2 * var(--g)), calc(86vh * var(--arn)));
  background: var(--ink); overflow: hidden;
}
.cover img, .cover__gl { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.cover img { object-fit: cover; }
.cover.is-gl img { visibility: hidden; }

.gallery { padding: clamp(64px, 9vw, 160px) var(--g); display: flex; flex-direction: column; gap: clamp(40px, 6vw, 110px); }
.g { margin: 0; display: flex; flex-direction: column; gap: 10px; }
.g img { width: 100%; height: auto; display: block; background: var(--paper-2); }
.g figcaption { font-size: 11px; letter-spacing: .05em; color: rgba(7,7,10,.66); font-variant-numeric: tabular-nums; }
.gallery > .g--full { width: min(100%, 1500px); }
.gallery > .g--full:nth-child(even) { width: min(78%, 1200px); align-self: flex-end; }
.g-pair { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(16px, 3vw, 48px); align-items: start; width: min(100%, 1180px); }
.g-pair .g:nth-child(2) { margin-top: clamp(48px, 9vw, 160px); }

.next { position: relative; background: var(--ink); color: var(--paper); padding: clamp(80px, 12vw, 180px) var(--g) var(--g); }
.next::before {
  content: ""; position: absolute; left: 0; right: 0; top: -47px; height: 48px; background: var(--ink);
  -webkit-mask-image: var(--ramp-v); mask-image: var(--ramp-v);
  -webkit-mask-size: 48px 48px; mask-size: 48px 48px;
  -webkit-mask-repeat: repeat-x; mask-repeat: repeat-x;
}
.next__link { display: block; }
.next__link small { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: rgba(239,236,228,.6); margin-bottom: 14px; }
.next__link span {
  display: block; font-family: var(--display); font-weight: 900; font-stretch: 100%;
  font-size: clamp(2.6rem, 7vw, 7.5rem); line-height: .86; letter-spacing: -.04em; text-transform: uppercase;
  transition: color .25s, font-stretch .6s var(--ease-out);
}
.next__link:hover span { color: var(--cyan); font-stretch: 125%; }
.next__all { display: inline-block; margin: clamp(48px, 6vw, 90px) 0 0; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; border-bottom: 1px solid currentColor; }

@media (max-width: 760px) {
  .bar--page { grid-template-columns: 1fr auto; }
  .bar--page .bar__role, .bar--page .bar__clock { display: none; }
  .projet__head { grid-template-columns: 1fr; }
  .projet__index { padding: 0; }
  .projet__about { grid-template-columns: 1fr; }
  .projet__title { font-size: 12.5vw; font-stretch: 100%; overflow-wrap: normal; }
  .gallery > .g--full:nth-child(even) { width: 100%; }
  .g-pair { grid-template-columns: 1fr; }
  .g-pair .g:nth-child(2) { margin-top: 0; }
  .next::before { top: -35px; height: 36px; -webkit-mask-size: 36px 36px; mask-size: 36px 36px; }
}

/* ==========================================================================
   Reduced motion
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
  .statement .w { opacity: 1; }
  .wipe { -webkit-mask-image: none; mask-image: none; }
  .mention { --w: 110; }
}
