:root {
  --bg: #EFEDE8; --fg: #111; --muted: #7a766f; --line: #d4d0c8; --ink: #000;
  --cond: "Archivo", system-ui, sans-serif; --mono: "Space Mono", ui-monospace, monospace;
  --g: clamp(16px, 2.2vw, 32px); --hdr: 112px;
  --ease: cubic-bezier(.3, 1.4, .5, 1);
}
* { box-sizing: border-box; }
html { background: var(--bg); color: var(--fg); scroll-behavior: smooth; }
body { background: var(--bg); margin: 0; font-family: var(--cond); font-stretch: 75%; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
a, button { color: inherit; font: inherit; cursor: pointer; background: none; border: 0; padding: 0; text-decoration: none; }
::selection { background: var(--fg); color: var(--bg); }
.mono { font-family: var(--mono); font-size: 11px; letter-spacing: .04em; text-transform: uppercase; line-height: 1.35; }
.up { text-transform: uppercase; }
svg.y2k { display: block; overflow: visible; }

/* ---------- HEADER (Prism) ---------- */
header { position: fixed; z-index: 50; color: var(--fg); top: 0; left: 0; right: 0; display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: clamp(14px, 3vw, 48px); padding: 14px var(--g); background: var(--bg); border-bottom: 1px solid var(--line); }
.logo { font-weight: 900; font-stretch: 62%; font-size: 34px; line-height: .8; letter-spacing: -.02em; }
.tagline { max-width: 260px; }
.tagline b { font-weight: 700; }
nav.cells { display: grid; grid-template-columns: repeat(4, minmax(90px, 150px)); }
.cell { position: relative; display: grid; place-items: center; height: 28px; font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; transition: background .2s, color .2s; }
.cell::before, .cell::after { content: "+"; position: absolute; top: -7px; font-size: 10px; opacity: .55; }
.cell::before { left: -3px; } .cell::after { right: -3px; }
.cell.on, .cell:hover { background: var(--fg); color: var(--bg); }
.lang { font-family: var(--mono); font-size: 11px; display: flex; gap: 2px; }
.lang button { padding: 4px 6px; }
.lang button.on { background: var(--fg); color: var(--bg); }

/* ---------- HERO ---------- */
.hero { position: relative; height: 100svh; min-height: 640px; overflow: hidden; }
.name { position: absolute; left: var(--g); right: var(--g); top: var(--hdr); margin: 0; font-weight: 800; font-stretch: 62%; line-height: .78; letter-spacing: -.015em; white-space: nowrap; text-transform: uppercase; font-size: 18vw; z-index: 2; }
.intro { position: absolute; z-index: 3; left: var(--g); top: calc(var(--hdr) + var(--nameH, 15vw) + 22px); max-width: 330px; font-size: 21px; line-height: 1.2; }
.intro .mono { display: block; margin-bottom: 10px; color: var(--muted); }

/* Y2K floating elements */
.fx { position: absolute; z-index: 2; pointer-events: none; }
.fx-star { right: 8vw; top: calc(var(--hdr) + var(--nameH, 15vw) + 10px); width: clamp(90px, 11vw, 170px); animation: spin 18s linear infinite; }
.fx-globe { left: 50%; translate: -50% 0; bottom: 9svh; width: clamp(220px, 27vw, 400px); }
.fx-orbit { left: 10vw; bottom: 16svh; width: clamp(100px, 10vw, 160px); }
.fx-spark { width: 22px; animation: blink 2.6s steps(2) infinite; }
@keyframes spin { to { rotate: 360deg; } }
@keyframes blink { 50% { opacity: .15; } }

/* Barbiana-style tags */
.tag { position: absolute; z-index: 4; background: var(--fg); color: var(--bg); padding: 1px 10px 3px; font-size: 24px; font-stretch: 62%; text-transform: uppercase; white-space: nowrap; transition: transform .3s var(--ease); }
@media (hover: hover) { .tag:hover { transform: translateY(-3px) rotate(-3deg); } }
.tag.tap { transform: translateY(-3px) rotate(-3deg); }
.t1 { right: calc(8vw + 40px); top: calc(var(--hdr) + var(--nameH, 15vw) + 70px); }
.t2 { left: 50%; translate: -50% 0; bottom: calc(9svh + clamp(90px, 11vw, 170px)); }
.t3 { left: calc(10vw + clamp(100px, 10vw, 160px) * .5); bottom: calc(16svh + clamp(100px, 10vw, 160px) * .3); translate: -50% 50%; }

/* bottom corners */
.corner-l { position: absolute; z-index: 4; left: var(--g); bottom: 18px; }
.corner-r { position: absolute; z-index: 4; right: var(--g); bottom: 18px; display: flex; align-items: end; gap: 14px; text-align: right; }
.barcode { height: 42px; display: flex; gap: 2px; align-items: stretch; }
.barcode i { background: var(--fg); }
.clock { font-variant-numeric: tabular-nums; }

/* ---------- MARQUEE (Atelier) ---------- */
.marquee { overflow: hidden; border-block: 1px solid var(--line); padding: 10px 0 6px; }
.marquee .track { display: flex; width: max-content; will-change: transform; }
.marquee span { display: flex; align-items: center; gap: .3em; padding-right: .3em; font-weight: 800; font-stretch: 62%; font-size: clamp(44px, 7vw, 96px); line-height: .9; text-transform: uppercase; white-space: nowrap; }
.marquee svg { height: .7em; width: auto; }

/* ---------- PROJECTS: rounded white cards ---------- */
section { position: relative; padding: clamp(60px, 9vw, 130px) var(--g); }
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: clamp(28px, 3vw, 44px) clamp(14px, 2vw, 24px); }
.card { position: relative; display: block; background: var(--fg); color: var(--bg); border-radius: 22px; aspect-ratio: 16 / 10; padding: 18px 20px; overflow: hidden; transition: border-radius .4s var(--ease), transform .4s var(--ease); }
.card .top { display: flex; justify-content: space-between; }
.card h3 { position: absolute; left: 20px; bottom: 34px; margin: 0; font-weight: 800; font-stretch: 62%; font-size: clamp(48px, 6.5vw, 104px); line-height: .82; text-transform: uppercase; }
.card .art { position: absolute; right: 6%; top: 50%; width: 40%; translate: 0 -50%; transition: rotate .8s var(--ease), scale .5s var(--ease); }
@media (hover: hover) { .card:hover { border-radius: 4px; } }
.card.tap { border-radius: 4px; }
@media (hover: hover) { .card:hover .art { scale: 1.08; } }
.card.tap .art { scale: 1.08; }
.notch { position: absolute; left: 50%; bottom: -1px; translate: -50% 0; background: var(--bg); color: var(--fg); padding: 7px 18px 5px; border-radius: 14px 14px 0 0; font-family: var(--mono); font-size: 11px; text-transform: uppercase; white-space: nowrap; }
/* outer curves: a transparent square with one rounded corner, filled around that corner by its own
   shadow (in the page colour). The shadow also runs 8px into the tab, so no seam can show where they meet
   (the old radial-gradient version left a hairline along the tangent of the curve) */
.notch::before, .notch::after { content: ""; position: absolute; bottom: 0; width: 14px; height: 14px; background: transparent; }
.notch::before { left: -14px; border-bottom-right-radius: 14px; box-shadow: 5px 5px 0 4px var(--bg); }   /* shadow starts 1px inside the square: no line on its outer edge */
.notch::after { right: -14px; border-bottom-left-radius: 14px; box-shadow: -5px 5px 0 4px var(--bg); }
.allbtn { display: flex; justify-content: center; margin-top: 30px; }
.pill { font-family: var(--mono); font-size: 11px; text-transform: uppercase; background: var(--fg); color: var(--bg); padding: 8px 16px; border-radius: 999px; transition: transform .3s var(--ease); }
@media (hover: hover) { .pill:hover { transform: scale(1.06); } }
.pill.tap { transform: scale(1.06); }

/* ---------- BIG TITLE + ARROW ---------- */
.big { display: flex; align-items: center; gap: .15em; margin: 0 0 40px; font-weight: 800; font-stretch: 62%; font-size: clamp(80px, 15vw, 240px); line-height: .8; text-transform: uppercase; }
.big svg { height: .72em; width: auto; transition: translate .4s var(--ease); }
@media (hover: hover) { .big:hover svg { translate: .12em 0; } }
.big.tap svg { translate: .12em 0; }

/* Prism "> " lists */
.cols { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: clamp(20px, 4vw, 60px); align-items: end; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; gap: 10px; padding: 7px 0; border-top: 1px solid var(--line); font-size: 20px; transition: padding .3s var(--ease); }
.list li::before { content: ">"; font-family: var(--mono); font-size: 13px; padding-top: 4px; color: var(--muted); }
@media (hover: hover) { .list li:hover { padding-left: 10px; } }
.list li.tap { padding-left: 10px; }
.list li small { margin-left: auto; font-family: var(--mono); font-size: 11px; color: var(--muted); padding-top: 5px; }
.list-h { margin-top: 8px; font-family: var(--mono); font-size: 11px; font-weight: 700; text-transform: uppercase; }
.about p { font-size: clamp(22px, 2.2vw, 30px); line-height: 1.15; margin: 0 0 14px; }

/* sticker */
.sticker { position: absolute; right: clamp(20px, 8vw, 140px); top: clamp(40px, 6vw, 90px); width: clamp(120px, 13vw, 180px); rotate: 12deg; transition: rotate .6s var(--ease); }
@media (hover: hover) { .sticker:hover { rotate: -8deg; } }
.sticker.tap { rotate: -8deg; }
.sticker text { font-family: var(--cond); font-stretch: 62%; font-weight: 800; }

/* ---------- CONTACT ---------- */
.contact { min-height: 80svh; display: flex; flex-direction: column; justify-content: space-between; border-top: 1px solid var(--line); }
.mail { display: inline-flex; align-items: center; gap: .2em; font-weight: 800; font-stretch: 62%; font-size: clamp(42px, 9vw, 150px); line-height: .85; text-transform: uppercase; border-bottom: 3px solid var(--fg); }
.mail:hover { background: var(--fg); color: var(--bg); }
footer { display: flex; justify-content: space-between; align-items: end; gap: 20px; flex-wrap: wrap; margin-top: 60px; }
.toast { position: fixed; z-index: 60; left: 50%; bottom: 24px; translate: -50% calc(100% + 40px); background: var(--fg); color: var(--bg); padding: 8px 14px; font-family: var(--mono); font-size: 11px; text-transform: uppercase; transition: translate .4s var(--ease); }
.toast.on { translate: -50% 0; }

/* HUD cursor */
/* ---------- CURSOR: dot + trailing ring ---------- */
/* white + "difference" blend = the cursor always shows the inverse of what's under it (dark on light, light on dark) */
.cur { position: fixed; left: 0; top: 0; z-index: 80; pointer-events: none; display: none; mix-blend-mode: difference; will-change: transform; }
@media (hover: hover) and (pointer: fine) {
  body, body * { cursor: none !important; }
  .c-dot, .c-ring { display: block; }
}
.c-dot { width: 6px; height: 6px; margin: -3px 0 0 -3px; border-radius: 50%; background: #fff; }
.c-ring { width: 36px; height: 36px; margin: -18px 0 0 -18px; border: 1px solid #fff; border-radius: 999px; display: grid; place-items: center; font-family: var(--mono); font-size: 10px; text-transform: uppercase; color: transparent; transition: width .35s var(--ease), height .35s var(--ease), margin .35s var(--ease), background .25s, color .25s; }
.c-ring.hot { width: 76px; height: 76px; margin: -38px 0 0 -38px; background: #fff; color: #000; }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 900px) {
  :root { --hdr: 116px; }
  header { grid-template-columns: auto 1fr auto; }
  .tagline { display: none; }
  nav.cells { grid-column: 1 / -1; grid-row: 2; grid-template-columns: repeat(4, 1fr); }
  .name { top: var(--hdr); }
  .intro { top: calc(var(--hdr) + var(--nameH) + 16px); font-size: 18px; max-width: 60vw; }
  .fx-globe { bottom: 18svh; width: 62vw; } .t2 { bottom: calc(18svh + 26vw); }
  .fx-star { top: auto; bottom: 34svh; right: 6vw; }
  .t1 { top: auto; bottom: calc(34svh + 20px); right: 6vw; }
  .fx-orbit { bottom: calc(14svh + 10px); left: var(--g); width: 104px; } .t3 { bottom: calc(14svh + 42px); left: calc(var(--g) + 52px); }
  .fx-globe { bottom: 24vh; width: 56vw; left: 58%; }
  .grid { grid-template-columns: 1fr; }
  .cols { grid-template-columns: 1fr; }
  .sticker { top: 10px; }
}
@media (max-width: 520px) {
  .corner-r { display: none; }
  .card { aspect-ratio: 4 / 5; }
  .card .art { top: 40%; width: 60%; right: 10%; }
  .card h3 { bottom: 56px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ================= PAGE: TOUS LES PROJETS ================= */
.page-head { padding-top: calc(var(--hdr) + clamp(30px, 5vw, 70px)); padding-bottom: 0; }
.page-head .mono { color: var(--muted); }
.page-head .big { margin: 10px 0 0; }
.page-head .count { font-family: var(--mono); font-size: clamp(14px, 1.4vw, 20px); font-weight: 400; align-self: flex-start; margin-top: .4em; }
.toolbar { position: sticky; top: var(--hv, var(--hh, 96px)); transition: top .35s cubic-bezier(.3, .7, .3, 1); z-index: 20; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 14px; padding: 14px var(--g); background: var(--bg); border-bottom: 1px solid var(--line); }
.chips, .views { display: flex; flex-wrap: wrap; gap: 4px; }
.chip { position: relative; padding: 6px 12px; font-family: var(--mono); font-size: 11px; text-transform: uppercase; border: 1px solid #fff; border-radius: 999px; transition: background .2s, color .2s; }
.chip sup { font-size: 8px; margin-left: 3px; }
.chip.on, .chip.press { background: var(--fg); color: var(--bg); }
@media (hover: hover) { .chip:hover { background: var(--fg); color: var(--bg); } }   /* phones: no sticky hover, .press for 0.3 s instead (site.js) */
.archive { padding-top: clamp(30px, 4vw, 50px); }
.archive .grid { grid-template-columns: repeat(3, 1fr); }
.archive .card h3 { font-size: clamp(40px, 4.4vw, 72px); }
.archive .card .art { width: 38%; top: 46%; }
.card.soon { background: transparent; color: var(--fg); border: 1px dashed var(--fg); }
.card.soon .notch { background: var(--bg); }
.card.hide, .prow.hide { display: none; }
/* list view */
.plist { display: none; border-top: 1px solid var(--fg); }
.archive.as-list .grid { display: none; }
.archive.as-list .plist { display: block; }
.prow { display: grid; grid-template-columns: 60px 1fr 1fr 80px 40px; align-items: center; gap: 16px; padding: 10px 12px; border-bottom: 1px solid var(--line); transition: background .2s, color .2s, padding .3s var(--ease); }
.prow .t { font-weight: 800; font-stretch: 62%; font-size: clamp(34px, 4vw, 60px); line-height: .9; text-transform: uppercase; }
.prow .mono { color: inherit; }
.prow svg { width: 22px; justify-self: end; transition: rotate .4s var(--ease); }
@media (hover: hover) { .prow:hover { background: var(--fg); color: var(--bg); padding-left: 22px; } }
.prow.tap { background: var(--fg); color: var(--bg); padding-left: 22px; }
@media (hover: hover) { .prow:hover svg { rotate: -45deg; } }
.prow.tap svg { rotate: -45deg; }
.prow.soon { color: var(--muted); }
.back { display: flex; justify-content: space-between; align-items: end; flex-wrap: wrap; gap: 20px; border-top: 1px solid var(--line); }
.empty { display: none; padding: 40px 0; font-family: var(--mono); font-size: 12px; text-transform: uppercase; color: var(--muted); }
@media (max-width: 1100px) { .archive .grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 900px) {
  .archive .grid { grid-template-columns: 1fr; }
  .prow { grid-template-columns: 40px 1fr 30px; }
  .prow .tags, .prow .yr { display: none; }
}
@media (max-width: 520px) { .archive .card { aspect-ratio: 16 / 12; } .archive .card .art { width: 42%; top: 50%; } .archive .card h3 { bottom: 48px; } }

/* ASCII canvases (ascii.js) */
canvas[data-ascii] { display: block; aspect-ratio: 1; color: var(--fg); }
.card canvas[data-ascii] { color: var(--bg); }
.card.soon canvas[data-ascii] { color: var(--fg); }


/* card → full screen transition (site.js) */
.veil { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; border-radius: 0 !important; pointer-events: none; }
.veil-t { font-weight: 800; font-stretch: 62%; font-size: clamp(64px, 14vw, 220px); line-height: .8; text-transform: uppercase; }

/* ================= PAGE: PROJET (projet.html?id=…) ================= */
.p-hero { position: relative; min-height: 100svh; padding: calc(var(--hh, 96px) + 20px) var(--g) 46px; background: var(--fg); color: var(--bg); border-radius: 0 0 26px 26px; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; }
.p-hero.soon { background: var(--bg); color: var(--fg); border-bottom: 1px dashed var(--fg); }
.p-top { position: relative; z-index: 2; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.p-art { position: absolute; z-index: 1; right: 6%; top: 46%; translate: 0 -50%; width: min(38vw, 52vh); }
.p-hero canvas[data-ascii] { color: var(--bg); }
.p-hero.soon canvas[data-ascii] { color: var(--fg); }
.p-title { position: relative; z-index: 2; margin: 0; font-weight: 800; font-stretch: 62%; line-height: .8; text-transform: uppercase; white-space: nowrap; }
.p-hero .notch { background: var(--bg); color: var(--fg); }
.p-hero.soon .notch { border: 1px dashed var(--fg); border-bottom: 0; }
.p-facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; padding-top: 50px; padding-bottom: 0; }
.p-facts div { display: flex; flex-direction: column; gap: 8px; padding: 14px 14px 14px 0; border-top: 1px solid var(--fg); }
.p-facts .mono { color: var(--muted); }
.p-facts b { font-weight: 500; font-size: 21px; }
.p-facts a { text-decoration: underline; }
.p-intro p { margin: 0; max-width: 1100px; font-size: clamp(30px, 4vw, 60px); line-height: 1.02; font-stretch: 70%; font-weight: 500; }
.p-media { padding-top: 0; }
.p-frame { max-width: 1200px; margin: 0 auto; border: 1px solid var(--fg); border-radius: 18px; overflow: hidden; background: #000; }
.p-bar { display: flex; align-items: center; gap: 6px; padding: 10px 14px; background: var(--bg); color: var(--fg); border-bottom: 1px solid var(--fg); }
.p-bar i { width: 9px; height: 9px; border-radius: 50%; border: 1px solid var(--fg); }
.p-bar a { margin-left: 10px; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; transition: color .2s; }
.p-bar a:hover { color: var(--fg); }
.p-view { position: relative; aspect-ratio: 16 / 9; overflow: hidden; }
.p-view iframe { position: absolute; left: 0; top: 0; width: 1600px; height: 900px; border: 0; transform: scale(var(--s, .5)); transform-origin: 0 0; }
.p-empty { display: grid; place-items: center; aspect-ratio: 16 / 9; background: transparent; border-style: dashed; color: var(--muted); }
.p-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: clamp(20px, 3vw, 44px); }
.p-steps article { border-top: 1px solid var(--fg); padding-top: 14px; }
.p-steps .mono { color: var(--muted); }
.p-steps h2 { margin: 8px 0 14px; font-weight: 800; font-stretch: 62%; font-size: clamp(40px, 4.4vw, 70px); line-height: .85; text-transform: uppercase; }
.p-steps p { margin: 0; font-size: 20px; line-height: 1.25; }
.p-next { display: flex; flex-direction: column; gap: 14px; }
.p-next .mono { color: var(--muted); }
.p-nextcard { aspect-ratio: auto; min-height: 280px; }
.p-nextcard h3 { font-size: clamp(64px, 11vw, 180px); }
.p-nextcard .art { width: min(30%, 240px); }
@media (max-width: 900px) {
  .p-facts { grid-template-columns: 1fr 1fr; }
  .p-steps { grid-template-columns: 1fr; }
  .p-art { width: 70vw; top: 42%; right: 50%; translate: 50% -50%; opacity: .9; }
}
.p-nextcard .art { top: 58%; }
.p-bar span { margin-left: 10px; color: var(--muted); }
.p-note { max-width: 1200px; margin: 0 auto 10px; color: var(--muted); }

/* ================= SINGLE-PAGE VIEWS (router.js) ================= */
.view { display: none; }
.view.on { display: block; }
[tabindex="-1"]:focus { outline: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.c-dot { transition: opacity .2s; } .c-dot.off { opacity: 0; }

/* ASCII portrait (hero centre) */
canvas.fx-portrait { z-index: 1; left: 50%; bottom: 0; translate: -50% 0; width: clamp(240px, 26vw, 420px); aspect-ratio: 260 / 359; }
.t2 { left: 50%; translate: -50% 0; bottom: calc(clamp(280px, 31vw, 480px) * .3); }
@media (max-width: 900px) {
  canvas.fx-portrait { width: min(70vw, 360px); }
  .t2 { display: block; bottom: calc(min(78vw, 420px) * .3); }
}
@media (max-width: 900px) { canvas.fx-portrait { bottom: 70px; } .t2 { bottom: calc(70px + min(78vw, 420px) * .3); } }
@media (max-width: 900px) { svg.fx-spark { display: none; } }

/* Footer background: The Creation of Adam in ASCII */
.contact { overflow: hidden; }
.contact > :not(canvas) { position: relative; z-index: 1; }
canvas.adam { position: absolute; z-index: 0; left: 50%; bottom: 0; translate: -50% 0; width: max(100%, 900px); aspect-ratio: 640 / 276; color: var(--muted); opacity: .85; pointer-events: none; }

/* Hero v2: giant name bottom-left on two lines, intro top-left, info top-right, portrait on the right */
.name { top: auto; right: auto; bottom: 22px; width: min(60vw, 900px); white-space: normal; line-height: .8; }
.intro { top: calc(var(--hdr) + 34px); }
.corner-l { bottom: auto; top: calc(var(--hdr) + 34px); left: auto; right: var(--g); text-align: right; }
canvas.fx-portrait { left: auto; right: 9vw; translate: 0 0; }
@media (max-width: 900px) {
  .name { top: auto; bottom: 18px; width: calc(100% - 2 * var(--g)); }
  .intro { top: calc(var(--hdr) + 24px); }
  .corner-l, .corner-r { display: none; }
  canvas.fx-portrait { right: 50%; translate: 50% 0; bottom: calc(var(--nameH, 30vw) * 1.6); }
}
.corner-r { bottom: auto; top: calc(var(--hdr) + 100px); }
@media (max-width: 900px) {
  canvas.fx-portrait { width: min(54vw, 300px); bottom: calc(var(--nameH, 30vw) * 1.25); }
}

/* Hero v3: giant name on ONE line, full width, at the bottom; portrait stands on it (behind the letters) */
.name { left: var(--g); right: var(--g); width: auto; white-space: nowrap; bottom: 22px; line-height: .78; }
canvas.fx-portrait { bottom: calc(22px + var(--nameH, 15vw) * .55); }
@media (max-width: 900px) {
  .name { width: auto; }
  canvas.fx-portrait { width: min(62vw, 340px); bottom: calc(18px + var(--nameH, 15vw) * .6); }
}
@media (min-width: 901px) { canvas.fx-portrait { right: 22vw; } }
/* name: one line but narrower than the page (font size is fitted to this width by the script) */
@media (min-width: 901px) { .name { right: auto; width: 68vw; } }
/* name a bit higher than the very bottom */
.name { bottom: 9svh; }
canvas.fx-portrait { bottom: calc(9svh + var(--nameH, 15vw) * .55); }
@media (max-width: 900px) { .name { bottom: 7svh; } canvas.fx-portrait { bottom: calc(7svh + var(--nameH, 15vw) * .6); } }
/* name raised further */
.name { bottom: 17svh; }
canvas.fx-portrait { bottom: calc(17svh + var(--nameH, 15vw) * .55); }
@media (max-width: 900px) { .name { bottom: 12svh; } canvas.fx-portrait { bottom: calc(12svh + var(--nameH, 15vw) * .6); } }
@media (min-width: 901px) { canvas.fx-portrait { width: clamp(220px, 23vw, 360px); max-height: calc(83svh - var(--hh, 96px) - var(--nameH, 15vw) * .55 - 16px); } }
/* clock + barcode back in the bottom-right corner */
.corner-r { top: auto; bottom: 18px; }
/* intro sits just above the giant name */
.intro { top: auto; bottom: calc(17svh + var(--nameH, 15vw) + 26px); }
@media (max-width: 900px) { .intro { top: auto; bottom: calc(12svh + var(--nameH, 15vw) + 16px); } }
@media (max-width: 900px) { canvas.fx-portrait { width: min(54vw, 300px); bottom: calc(12svh + var(--nameH, 15vw) + 104px); } }
/* intro on a single line (desktop); wraps normally on phones */
@media (min-width: 901px) { .intro { max-width: none; white-space: nowrap; } }
/* intro closer to the name */
.intro { bottom: calc(17svh + var(--nameH, 15vw) + 10px); }
@media (max-width: 900px) { .intro { bottom: calc(12svh + var(--nameH, 15vw) + 8px); } }
.intro { bottom: calc(17svh + var(--nameH, 15vw) - 8px); }

/* Hero v4 — option 2: big light-grey ASCII portrait behind the name */
canvas.fx-portrait { z-index: 0; left: 50%; right: auto; translate: -50% 0; bottom: 0; width: min(62svh, 88vw); max-height: none; color: #c4c0b8; }
@media (min-width: 901px) { canvas.fx-portrait { right: auto; width: min(62svh, 88vw); } }
@media (max-width: 900px) { canvas.fx-portrait { width: min(92vw, 62svh); bottom: 0; } }
@media (min-width: 901px) { canvas.fx-portrait { left: 62%; } }


/* ================= NAV v2 — "A": thin numbered line, hides on scroll down ================= */
header { display: flex; justify-content: space-between; align-items: center; gap: 24px; padding: 16px var(--g); background: transparent; border-bottom: 0; transition: transform .35s cubic-bezier(.3, .7, .3, 1), background .25s; }
header.solid { background: var(--bg); }                       /* once the page has scrolled: readable over content */
header.hide { transform: translateY(-105%); }
.logo { font-size: 28px; }
nav.cells { display: flex; align-items: center; gap: clamp(14px, 2vw, 26px); grid-template-columns: none; }
.cell { position: relative; display: inline-flex; gap: 6px; height: auto; color: var(--muted); background: none; transition: color .2s; }
.cell::before, .cell::after { content: none; }
.cell b { font-weight: 400; color: var(--fg); }
.cell:hover, .cell.on { background: none; color: var(--fg); }
.cell.on::before { content: "→"; position: absolute; left: -15px; top: 0; opacity: 1; font-size: inherit; }
.lang { display: flex; align-items: center; gap: 4px; margin-left: 8px; color: var(--muted); }
.lang button { padding: 0; color: var(--muted); }
.lang button.on { background: none; color: var(--fg); }
@media (max-width: 900px) {
  header { display: flex; flex-wrap: wrap; row-gap: 10px; }
  nav.cells { grid-column: auto; grid-row: auto; width: 100%; justify-content: space-between; gap: 8px; order: 2; }
  .cell b { display: none; }
  .cell.on::before { left: -12px; }
  .lang { margin-left: 0; }
}
:root { --hdr: 74px; }
@media (max-width: 900px) { :root { --hdr: 100px; } }

/* Contact v2: the address itself, big — click copies; two explicit actions below */
.mail { display: inline-block; position: relative; border-bottom: 0; text-transform: none; font-size: clamp(34px, 6.4vw, 112px); line-height: .9; letter-spacing: -.01em; padding-bottom: 8px; text-align: left; }
.mail:hover { background: none; color: inherit; }
.mail::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--fg); transform: scaleX(0); transform-origin: 0 50%; transition: transform .45s cubic-bezier(.65, 0, .25, 1); }
.mail:hover::after, .mail:focus-visible::after, .mail.done::after { transform: scaleX(1); }
.mail.done .mail-t { color: var(--muted); }
.mail-actions { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 18px; }
.mail-actions a, .mail-actions button { color: var(--fg); transition: color .2s; }
.mail-actions a:hover, .mail-actions button:hover { color: var(--muted); }
.mail-actions a[href^="tel"] { color: var(--muted); }
@media (max-width: 520px) { .mail { font-size: clamp(26px, 9vw, 44px); } }
.list li::before { color: var(--fg); }

/* custom cursor only on devices with a real mouse (the ring's own "display: grid" used to override the hiding) */
.c-dot, .c-ring { display: none !important; }
@media (hover: hover) and (pointer: fine) {
  .c-dot { display: block !important; }
  .c-ring { display: grid !important; }
}

/* click shock-wave layer (site.js) — white + difference: visible on light and dark */
.wave-layer[hidden] { display: none; }
.wave-layer { position: fixed; left: 0; top: 0; width: 100vw; height: 100vh; z-index: 90; pointer-events: none; mix-blend-mode: difference; }

/* ================= PHONE MENU (full-screen curtain) ================= */
.menu-btn { display: none; align-items: center; gap: 10px; }
.mnav { position: fixed; inset: var(--hh, 70px) 0 0 0; z-index: 49; display: flex; flex-direction: column; justify-content: space-between; padding: 30px var(--g) calc(24px + env(safe-area-inset-bottom, 0px)); background: var(--fg); color: var(--bg); clip-path: inset(0 0 100% 0); visibility: hidden; transition: clip-path .6s cubic-bezier(.75, 0, .2, 1), visibility 0s .6s; }
.mnav.open { clip-path: inset(0 0 0 0); visibility: visible; transition: clip-path .6s cubic-bezier(.75, 0, .2, 1), visibility 0s; }
.mnav nav { display: flex; flex-direction: column; gap: 4px; }
.mnav nav a { display: flex; align-items: baseline; gap: 12px; padding: 6px 0; font-weight: 800; font-stretch: 62%; font-size: clamp(56px, 17vw, 96px); line-height: .9; text-transform: uppercase; opacity: 0; transform: translateY(24px); transition: opacity .4s, transform .5s var(--ease); }
.mnav nav a span.mono { font-size: 12px; font-weight: 400; }
.mnav.open nav a { opacity: 1; transform: none; }
.mnav.open nav a:nth-child(2) { transition-delay: .06s; } .mnav.open nav a:nth-child(3) { transition-delay: .12s; } .mnav.open nav a:nth-child(4) { transition-delay: .18s; }
.mnav nav a.on { text-decoration: underline; text-decoration-thickness: 4px; text-underline-offset: 8px; }
.mnav-foot { display: flex; justify-content: space-between; gap: 12px; color: #9a968e; }
.mnav-foot button.on { color: var(--bg); }
/* menu open: the bar takes the curtain's colours (inverted), the curtain unrolls from its bottom edge */
header.menu-open { background: var(--fg) !important; color: var(--bg); transform: none !important; }
header.menu-open .logo { color: var(--bg); }
@media (max-width: 900px) { header, header .logo { transition: transform .35s cubic-bezier(.3, .7, .3, 1), background .35s, color .35s; } }
@media (max-width: 900px) {
  header { flex-wrap: nowrap; }
  nav.cells { display: none; }
  .menu-btn { display: inline-flex; }
}

/* iPhone safe areas (viewport-fit=cover): keep content clear of the status bar and home indicator */
header { padding-top: max(16px, env(safe-area-inset-top, 0px)); }
.contact { padding-bottom: calc(clamp(60px, 9vw, 130px) + env(safe-area-inset-bottom, 0px)); }
:root { --hdr: 74px; }
@media (max-width: 900px) { :root { --hdr: calc(64px + env(safe-area-inset-top, 0px)); } }
/* burger: 3 bars (i = middle, ::before = top, ::after = bottom) → cross.
   open: outer bars slide to the middle, then rotate; close: the same in reverse */
.menu-btn i { position: relative; width: 24px; height: 1.5px; background: currentColor; transition: background-color 0s .2s; }
.menu-btn i::before, .menu-btn i::after { content: ""; position: absolute; left: 0; width: 100%; height: 1.5px; background: currentColor;
  transition: translate .2s var(--ease) .2s, rotate .2s var(--ease); }
.menu-btn i::before { top: 0; translate: 0 -7px; }
.menu-btn i::after  { top: 0; translate: 0 7px; }
.menu-btn[aria-expanded="true"] i { background-color: transparent; transition-delay: .2s; }
.menu-btn[aria-expanded="true"] i::before, .menu-btn[aria-expanded="true"] i::after { translate: 0 0; transition: translate .2s var(--ease), rotate .25s var(--ease) .2s; }
.menu-btn[aria-expanded="true"] i::before { rotate: 45deg; }
.menu-btn[aria-expanded="true"] i::after  { rotate: -45deg; }
.menu-btn { padding-block: 8px; }

/* toast: really hidden when not shown (on iPhone the page now extends under Safari's bottom bar,
   so "pushed below the screen" was no longer out of sight) */
.toast { bottom: calc(24px + env(safe-area-inset-bottom, 0px)); opacity: 0; visibility: hidden; transition: translate .4s var(--ease), opacity .25s, visibility 0s .4s; }
.toast.on { opacity: 1; visibility: visible; transition: translate .4s var(--ease), opacity .25s, visibility 0s; }

/* menu links: animate only when OPENING (keyframes); when closing they stay perfectly still
   while the curtain slides up — before, they drifted down as their transition reversed */
.mnav nav a { opacity: 1; transform: none; transition: none; }
.mnav.open nav a { animation: mnav-in .5s var(--ease) both; }
.mnav.open nav a:nth-child(2) { animation-delay: .06s; }
.mnav.open nav a:nth-child(3) { animation-delay: .12s; }
.mnav.open nav a:nth-child(4) { animation-delay: .18s; }
@keyframes mnav-in { from { opacity: 0; transform: translateY(24px); } }
@media (prefers-reduced-motion: reduce) { .mnav.open nav a { animation: none; } }
.mnav[hidden] { display: none; }
@media (max-width: 900px) { canvas.fx-portrait { bottom: 8svh; } }
@media (max-width: 900px) { canvas.fx-portrait { bottom: 24svh; } }
@media (max-width: 900px) { canvas.fx-portrait { bottom: 19svh; } }

/* outside the home page the header always has its background (the project page starts with a black block,
   a transparent header would be dark-on-black = invisible) */
html:not([data-view="home"]) header { background: var(--bg); }

/* menu open: the page is locked (overflow hidden), so iOS Safari stops showing content under its address bar
   and fills it with the root (html) colour instead. The root turns dark like the menu; the body keeps the
   light background, so nothing changes on screen except the bar. */
html.menu-open { background: var(--fg); }

/* phones have no hover: a tap adds .tap (site.js), removed after 1 s so the element slides back */

/* phones: info strip under the giant name — practical info left, clock + barcode right (no X/Y: no mouse) */
.corner-m { display: none; }
@media (max-width: 900px) {
  .corner-m, .corner-r { position: absolute; z-index: 4; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); }
  .corner-m { display: block; left: var(--g); }
  .corner-r { display: flex; top: auto; right: var(--g); gap: 10px; }
  .corner-r .barcode { height: 28px; }
  .coords-w { display: none; }
}

/* phones: Safari's address bar floats over the bottom of the screen (the page runs under it), so the
   marquee peeked out behind it on arrival. Push it below by the height of that hidden zone
   (100lvh − 100svh when Safari reports it, at least ~ the bar's height + home indicator). */
@media (max-width: 900px) {
  .marquee { margin-top: max(calc(100lvh - 100svh), calc(72px + env(safe-area-inset-bottom, 0px))); }
}

/* ---------- SCROLLBAR (desktop; phones keep their native overlay bar) ----------
   site style: flat paper track with a hairline, square black block as thumb;
   on hover the block turns into a barcode (same motif as the hero corner) */
@media (hover: hover) and (pointer: fine) {
  html::-webkit-scrollbar { width: 12px; }
  html::-webkit-scrollbar-track { background: var(--bg); border-left: 1px solid var(--line); }
  html::-webkit-scrollbar-thumb { background: var(--fg); border: 3px solid var(--bg); border-left-width: 4px; min-height: 48px; }
  html::-webkit-scrollbar-thumb:hover,
  html::-webkit-scrollbar-thumb:active {
    border-width: 2px; border-left-width: 3px;
    background: repeating-linear-gradient(to bottom, var(--fg) 0 2px, var(--bg) 2px 3px, var(--fg) 3px 6px, var(--bg) 6px 7px);
  }
  html::-webkit-scrollbar-corner { background: var(--bg); }
  /* Firefox (no ::-webkit-scrollbar): closest match with the standard properties */
  @supports not selector(::-webkit-scrollbar) {
    html { scrollbar-color: var(--fg) var(--bg); scrollbar-width: thin; }
  }
}
::selection { background: var(--fg); color: var(--bg); }

/* projects toolbar: desktop = 2 rows (type + display, language + order); phones = compact bar + unrolling panel */
.toolbar { flex-direction: column; flex-wrap: nowrap; gap: 8px; }      /* nowrap: rows stay as wide as the screen */
.tb-row { width: 100%; min-width: 0; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 14px; }
.chips, .views { align-items: center; }
.tb-l { width: 64px; font-size: 10px; color: var(--muted); }
.views .tb-l { width: auto; margin-right: 6px; }
.tb-in { display: flex; flex-direction: column; gap: 8px; }
.tb-m, .tb-actions { display: none; }
@media (max-width: 900px) {
  /* phones: compact bar ("Filtres ▾" + Grille / Liste); the filters unroll in a panel below it */
  .toolbar { gap: 0; padding-block: 10px; }
  .tb-m { display: flex; justify-content: space-between; align-items: center; width: 100%; }
  .tb-toggle i { display: inline-block; margin-left: 6px; font-style: normal; transition: rotate .35s var(--ease); }
  .toolbar.open .tb-toggle i { rotate: 180deg; }
  .tb-row > .views:not([data-sort]) { display: none; }                  /* Grille / Liste live in the bar */
  .tb-panel { display: grid; grid-template-rows: 0fr; width: 100%; transition: grid-template-rows .45s var(--ease); }
  .toolbar.open .tb-panel { grid-template-rows: 1fr; }
  .tb-in { min-height: 0; overflow: hidden; gap: 0; }
  .toolbar.open .tb-in { max-height: calc(100svh - var(--hh, 64px) - 70px); overflow-y: auto; overscroll-behavior: contain; }
  .tb-row { flex-direction: column; align-items: flex-start; gap: 8px; padding-top: 16px; }
  .tb-row .chips, .tb-row .views { flex-wrap: wrap; gap: 6px; }
  .tb-l { width: 100%; margin: 0 0 2px; }
  .views .tb-l { width: 100%; margin: 0 0 2px; }                       /* Ordre: label above its buttons, like the others */
  .tb-actions { display: flex; justify-content: space-between; align-items: center; padding: 18px 0 6px; }
  .tb-actions .mono { color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
}

/* Parcours: experiences (title, place, short description) */
.list li.xp > div { display: flex; flex-direction: column; gap: 4px; }
.xp b { font-weight: inherit; line-height: 1.1; }
.xp-o { font-size: 10px; color: var(--muted); }
.xp-d { font-size: 14px; line-height: 1.35; color: var(--muted); }
.list li small { white-space: nowrap; }

/* Parcours without the intro text: experiences + formation | tools */
.cols-2 { grid-template-columns: 1.4fr 1fr; align-items: start; }
@media (max-width: 900px) { .cols-2 { grid-template-columns: 1fr; } }
/* 2×2 grid: Expériences | Compétences, then Formation | Langues — the second row starts at the same height */
.cols-2 { row-gap: clamp(36px, 4vw, 56px); }
@media (max-width: 900px) {
  .b-xp { order: 1; } .b-fo { order: 2; } .b-sk { order: 3; } .b-la { order: 4; }   /* phones: career first, then skills */
}
/* phones: no "Dispo stage · alternance" sticker (the home intro already says it) */
@media (max-width: 900px) { .sticker { display: none; } }

