/* Portfolio pages: home, Work, each work, About.
   Plain and neutral on purpose: white, thin rules, one sans plus a mono for data. The images do the work. */

:root {
    --ink: #0d0d0d;
    --mute: #666;
    --faint: #999;
    --rule: #e3e3e0;
    --ground: #f1f1ef;
    --pad: 40px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
    background: #fff;
    color: var(--ink);
    font: 15px/1.55 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
    -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
img, video { display: block; max-width: 100%; }
.mono { font-family: 'IBM Plex Mono', ui-monospace, Menlo, Consolas, monospace; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 8px; top: 8px; background: #fff; padding: 6px 10px; z-index: 10; }

/* language: both languages sit in the page, one is hidden */
html:not([lang="fr"]) [data-l="fr"],
html[lang="fr"] [data-l="en"] { display: none !important; }

/* ---------- header ---------- */
.top {
    display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap;
    min-height: 72px; padding: 12px var(--pad); border-bottom: 1px solid var(--ink); font-size: 13px; line-height: 1.2;
}
.brand { font-weight: 500; letter-spacing: .02em; text-decoration: none; text-transform: uppercase; }
.nav { display: flex; align-items: center; gap: 26px; flex-wrap: wrap; }
.nav a { text-decoration: none; }
.nav a:hover { text-decoration: underline; text-underline-offset: 5px; }
.nav a[aria-current="page"] { text-decoration: underline; text-underline-offset: 5px; }
.lang { display: inline-flex; gap: 4px; color: var(--faint); }
.lang button {
    font: inherit; color: inherit; background: none; border: 0; padding: 2px 3px; cursor: pointer;
}
.lang button[aria-pressed="true"] { color: var(--ink); text-decoration: underline; text-underline-offset: 5px; }

/* ---------- shared bits ---------- */
.label { font: 400 12px 'IBM Plex Mono', monospace; letter-spacing: .04em; text-transform: uppercase; }
.tag {
    display: inline-block; font: 400 11px 'IBM Plex Mono', monospace; letter-spacing: .04em; text-transform: uppercase;
    border: 1px solid currentColor; border-radius: 20px; padding: 1px 8px; line-height: 1.5; white-space: nowrap;
}
/* the chain a work lives on, quiet, right after its name */
.chain { font: 400 .62em 'IBM Plex Mono', ui-monospace, Menlo, Consolas, monospace; color: var(--faint); letter-spacing: .03em; white-space: nowrap; margin-left: .15em; }
.sheet-meta h1 .chain { font-size: .28em; vertical-align: .9em; }
.plain-list .s .yr { color: var(--faint); font-size: 11.5px; }
.tag.mute { color: #777; border-color: #ccc; margin-left: 8px; font-size: 10px; }
.key { color: var(--faint); font-size: .7em; margin-left: .4em; vertical-align: .15em; cursor: help; }
.plain-link { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: #bbb; }
.plain-link:hover { text-decoration-color: var(--ink); }

.footer {
    display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap;
    padding: 28px var(--pad) 36px; border-top: 1px solid var(--ink); font-size: 12.5px; color: var(--mute);
}
.footer nav { display: flex; gap: 22px; flex-wrap: wrap; }

/* ---------- home ---------- */
.home { display: grid; grid-template-columns: minmax(0, 1fr) 720px; }
.home-l { padding: 44px var(--pad) 36px; display: flex; flex-direction: column; justify-content: space-between; gap: 48px; border-right: 1px solid var(--ink); }
.home-name { font: 500 clamp(52px, 7vw, 92px)/.96 'IBM Plex Sans', sans-serif; letter-spacing: -.045em; }
.home-one { margin-top: 26px; font: 300 clamp(26px, 2.5vw, 34px)/1.2 'IBM Plex Sans', sans-serif; letter-spacing: -.02em; max-width: 620px; }
.home-based { margin-top: 20px; color: var(--mute); max-width: 460px; }
.latest { margin-top: 44px; }
.latest h2, .index h2 { font: 400 12px 'IBM Plex Mono', monospace; letter-spacing: .04em; text-transform: uppercase; margin-bottom: 10px; }
.latest a { display: grid; grid-template-columns: 1fr auto; gap: 16px; padding: 12px 0; border-top: 1px solid var(--ink); text-decoration: none; }
.latest a:hover b { text-decoration: underline; text-underline-offset: 4px; }
.latest b { display: block; font: 500 22px/1.2 'IBM Plex Sans', sans-serif; letter-spacing: -.01em; }
.latest .f { color: #555; }
.latest .tag { align-self: start; }
.index a { display: grid; grid-template-columns: 70px 1fr auto; padding: 9px 0; border-top: 1px solid #ddd; text-decoration: none; font-size: 13px; }
.index a:hover span:nth-child(2) { text-decoration: underline; text-underline-offset: 4px; }
.index a span:last-child { color: var(--faint); }

.sheet { display: grid; grid-template-columns: repeat(3, 1fr); align-content: start; }
.cell { text-decoration: none; position: relative; background: var(--ground); overflow: hidden; aspect-ratio: 1 / 1; border-right: 1px solid #fff; border-bottom: 1px solid #fff; display: block; }
.cell img, .cell video { width: 100%; height: 100%; object-fit: contain; }
.cell.big { grid-column: 1 / 3; grid-row: 1 / 3; background: #000; }
.cell .tag { position: absolute; left: 10px; top: 10px; background: #fff; color: var(--ink); border-color: #fff; }
.cell.soon { display: flex; align-items: flex-end; padding: 12px; font: 12px 'IBM Plex Mono', monospace; color: #888; }
.cell.dark { background: #000; }
.cell.cover img { object-fit: cover; }
.cell.wide { grid-column: span 2; aspect-ratio: 2 / 1; }
.cell.wide img { object-fit: cover; }

/* ---------- Work page ---------- */
.intro { display: grid; grid-template-columns: 1fr 2fr; gap: 40px; padding: 44px var(--pad) 52px; }
.intro p { font: 300 28px/1.35 'IBM Plex Sans', sans-serif; letter-spacing: -.015em; max-width: 1000px; }
.lat { border-top: 1px solid var(--ink); padding: 22px var(--pad) 44px; }
.lat > .label { margin-bottom: 18px; }
.lat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.lat a { text-decoration: none; }
.lat .ph { position: relative; height: 400px; background: var(--ground); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.lat .ph.dk { background: #000; }
.lat .ph img, .lat .ph video { max-width: 100%; max-height: 100%; width: auto; height: auto; }
.lat .ph .tag { position: absolute; left: 14px; top: 14px; background: #fff; color: var(--ink); border-color: #fff; }
.lat h3 { font: 500 22px/1.2 'IBM Plex Sans', sans-serif; letter-spacing: -.015em; margin-top: 14px; }
.lat a:hover h3 { text-decoration: underline; text-underline-offset: 4px; }
.lat .f { color: #333; margin-top: 2px; }
.lat .te { font: 400 12px/1.5 'IBM Plex Mono', monospace; color: #777; margin-top: 6px; }

.chh { display: grid; grid-template-columns: 240px 1fr; gap: 40px; padding: 22px var(--pad); border-top: 1px solid var(--ink); }
.chh h2 { font: 400 28px/1.1 'IBM Plex Sans', sans-serif; letter-spacing: -.015em; }
.chh p { margin-top: 6px; color: var(--mute); max-width: 700px; }
.chh.prologue h2 { display: none; }
.chh.prologue p { margin-top: 0; }
.row { display: grid; grid-template-columns: 50px 112px 1.15fr 1.45fr 1.4fr; gap: 24px; align-items: center; padding: 14px var(--pad); border-top: 1px solid var(--rule); text-decoration: none; }
.row:hover .ti span.t { text-decoration: underline; text-underline-offset: 4px; }
.row .th { width: 112px; height: 112px; background: var(--ground); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.row .th.dk { background: #000; }
.row .th img, .row .th video { max-width: 100%; max-height: 100%; width: auto; height: auto; }
.row .no { font: 400 12px 'IBM Plex Mono', monospace; color: var(--faint); }
.row .ti { font: 500 19px/1.25 'IBM Plex Sans', sans-serif; }
.row .ti .tag { margin-left: 8px; color: #777; border-color: #ccc; font-weight: 400; font-size: 10px; }
.row .te { font: 400 12px/1.5 'IBM Plex Mono', monospace; color: #777; }
.row.nolink { cursor: default; }
/* a chapter that is not finished: a quiet placeholder line */
.row.more { cursor: default; }
.row.subh { padding-top: 26px; padding-bottom: 10px; border-top-style: dashed; }
.row.subh .label { grid-column: 2 / -1; color: var(--mute); }
.row.more .th { background: transparent; border: 1px dashed #c9c9c4; }
.row.more .ti .t { font-weight: 400; font-style: italic; color: var(--faint); }

.sec { padding: 50px var(--pad) 36px; border-top: 1px solid var(--ink); }
.sec > .label { margin-bottom: 20px; }
.sec > .note { margin: -6px 0 18px; max-width: 640px; color: var(--mute); }
.series { display: grid; grid-template-columns: minmax(0, 360px) 1fr; gap: 48px; align-items: center; }
.series p { font: 300 24px/1.4 'IBM Plex Sans', sans-serif; letter-spacing: -.01em; max-width: 720px; }
.series .more { display: inline-block; margin-top: 18px; font-size: 14px; }
.plain-list > div, .plain-list > a { display: grid; grid-template-columns: 56px 1fr 1.3fr; gap: 24px; align-items: center; padding: 12px 0; border-top: 1px solid var(--rule); text-decoration: none; }
.plain-list.noimg > div, .plain-list.noimg > a { grid-template-columns: 1fr 1.3fr; }
.plain-list .b { font: 500 17px 'IBM Plex Sans', sans-serif; }
.plain-list .s { color: var(--mute); font-size: 14px; }
.plain-list .mini { width: 56px; height: 56px; background: var(--ground); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.plain-list .mini img { max-width: 100%; max-height: 100%; }
.plain-list a:hover .b { text-decoration: underline; text-underline-offset: 4px; }

/* ---------- a work ---------- */
.crumb { padding: 22px var(--pad) 0; font: 400 12px 'IBM Plex Mono', monospace; color: var(--faint); }
.crumb a { text-decoration: none; }
.crumb a:hover { text-decoration: underline; }
.hero { padding: 22px var(--pad) 0; display: flex; justify-content: center; }
/* the frame takes the picture's own ratio (--r) and a sensible width (--w): no wide banner around a small picture */
.hero-frame { width: min(100%, var(--w, 820px), calc(82vh * var(--r, 1.6))); aspect-ratio: var(--r, 1.6); background: var(--ground); display: flex; justify-content: center; align-items: center; overflow: hidden; }
.hero-frame.dk { background: #000; }
.hero-frame img, .hero-frame video { width: 100%; height: 100%; max-width: none; max-height: none; object-fit: cover; }
.sheet-meta { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 56px; padding: 44px var(--pad) 56px; }
.sheet-meta h1 { font: 500 clamp(34px, 4.2vw, 56px)/1.04 'IBM Plex Sans', sans-serif; letter-spacing: -.035em; }
.sheet-meta .status { margin-left: 10px; vertical-align: .55em; color: #555; }
.facet { margin-top: 14px; font: 400 21px/1.3 'IBM Plex Sans', sans-serif; letter-spacing: -.01em; }
.facts { margin-top: 28px; border-top: 1px solid var(--ink); }
.facts div { display: grid; grid-template-columns: 120px 1fr; gap: 14px; padding: 9px 0; border-bottom: 1px solid var(--rule); font-size: 13.5px; }
.facts dt { font: 400 12px 'IBM Plex Mono', monospace; color: var(--faint); text-transform: uppercase; letter-spacing: .03em; padding-top: 2px; }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.logic { font: italic 300 20px/1.45 'IBM Plex Sans', sans-serif; color: #333; border-left: 2px solid var(--ink); padding-left: 18px; margin-bottom: 26px; max-width: 640px; }
.desc p { font: 400 18px/1.65 'IBM Plex Sans', sans-serif; max-width: 640px; }
.desc p + p { margin-top: 1em; }
.links { margin-top: 30px; max-width: 640px; }
.links a { display: flex; justify-content: space-between; gap: 20px; padding: 11px 0; border-top: 1px solid var(--rule); text-decoration: none; font-size: 15px; }
.links a:last-child { border-bottom: 1px solid var(--rule); }
.links a:hover span:first-child { text-decoration: underline; text-underline-offset: 4px; }
.links .k { font: 400 12px 'IBM Plex Mono', monospace; color: var(--faint); text-transform: uppercase; }
.extras { padding: 0 var(--pad) 56px; display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 24px; }
.extras figure { background: var(--ground); }
.extras img { width: 100%; height: auto; }
.extras figcaption { padding: 10px 2px 0; font-size: 13px; color: var(--mute); background: #fff; }
.pn { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--ink); }
.pn a { padding: 24px var(--pad) 28px; text-decoration: none; }
.pn a + a { border-left: 1px solid var(--rule); text-align: right; }
.pn .label { color: var(--faint); }
.pn b { display: block; font: 500 22px/1.2 'IBM Plex Sans', sans-serif; letter-spacing: -.01em; margin-top: 4px; }
.pn a:hover b { text-decoration: underline; text-underline-offset: 4px; }

/* ---------- About ---------- */
.about-head { padding: 44px var(--pad) 8px; display: grid; grid-template-columns: 1fr 2fr; gap: 40px; align-items: end; }
.about-head h1 { font: 500 clamp(48px, 6.4vw, 88px)/.98 'IBM Plex Sans', sans-serif; letter-spacing: -.045em; }
.about-head p { font: 300 28px/1.3 'IBM Plex Sans', sans-serif; letter-spacing: -.015em; max-width: 760px; }
.about-sec { display: grid; grid-template-columns: 1fr 2fr; gap: 40px; padding: 36px var(--pad) 40px; border-top: 1px solid var(--ink); margin-top: 44px; }
.about-sec + .about-sec { margin-top: 0; }
.about-sec .body p { font: 400 18px/1.65 'IBM Plex Sans', sans-serif; max-width: 680px; }
.about-sec .body p + p { margin-top: 1em; }
.cv h3 { font: 400 12px 'IBM Plex Mono', monospace; letter-spacing: .04em; text-transform: uppercase; color: var(--faint); margin: 28px 0 8px; }
.cv h3:first-child { margin-top: 0; }
.cv .line { display: grid; grid-template-columns: 150px 1fr; gap: 16px; padding: 7px 0; border-bottom: 1px solid var(--rule); max-width: 680px; }
.cv .line .y { font: 400 12px 'IBM Plex Mono', monospace; color: var(--faint); padding-top: 3px; }
.cv .line .n small { display: block; color: var(--mute); font-size: 13px; }
.contact a.big { font: 300 clamp(24px, 3vw, 38px)/1.2 'IBM Plex Sans', sans-serif; letter-spacing: -.02em; text-decoration: none; border-bottom: 1px solid var(--ink); }
.contact p { margin-top: 18px; color: var(--mute); }
.soon-note { color: var(--faint); }

/* ---------- small screens ---------- */
@media (max-width: 1100px) {
    .home { grid-template-columns: 1fr; }
    .home-l { border-right: 0; border-bottom: 1px solid var(--ink); }
    .sheet { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 820px) {
    :root { --pad: 20px; }
    .intro, .about-head, .about-sec, .sheet-meta { grid-template-columns: 1fr; gap: 18px; }
    .intro p { font-size: 22px; }
    .about-head p { font-size: 22px; }
    .lat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
    .lat .ph { height: 240px; }
    .chh { grid-template-columns: 1fr; gap: 6px; }
    .row { grid-template-columns: 84px 1fr; grid-template-areas: "th ti" "th fa" "th te"; gap: 2px 16px; padding: 14px var(--pad); }
    .row .no { display: none; }
    .row.subh { display: block; }
    .row .th { grid-area: th; width: 84px; height: 84px; }
    .row .ti { grid-area: ti; font-size: 17px; }
    .row .fa { grid-area: fa; font-size: 14px; }
    .row .te { grid-area: te; font-size: 11.5px; }
    .series { grid-template-columns: 1fr; gap: 20px; }
    .plain-list > div, .plain-list > a { grid-template-columns: 56px 1fr; }
    .plain-list.noimg > div, .plain-list.noimg > a { grid-template-columns: 1fr; gap: 2px; }
    .plain-list .s { grid-column: 2; }
    .plain-list.noimg .s { grid-column: 1; }
    .facts div { grid-template-columns: 96px 1fr; }
    .pn { grid-template-columns: 1fr; }
    .pn a + a { border-left: 0; border-top: 1px solid var(--rule); text-align: left; }
    .nav { gap: 16px; }
    .latest a { grid-template-columns: 1fr; gap: 4px; }
}
@media (max-width: 520px) {
    .sheet .cell.big { grid-column: 1 / 3; grid-row: auto; }
    .sheet { grid-template-columns: repeat(2, 1fr); }
    .index a { grid-template-columns: 44px 1fr auto; }
}
@media (prefers-reduced-motion: reduce) {
    * { scroll-behavior: auto !important; }
}

/* =====================================================================
   MOTION
   Everything here moves with transform, opacity or clip-path only (the compositor does the work,
   nothing is laid out again), runs once, and is off for visitors who ask for less motion.
   - the page arrives in order (data-in) and things rise as they scroll into view (data-r):
     with CSS scroll-driven animations where the browser has them, with a tiny observer where not
   - pages cross-fade into each other, and a picture in a list grows into the page that opens
   - the pictures answer the pointer (hover), videos only play while visible (site.js)
   ===================================================================== */
:root { --ease: cubic-bezier(.2, .8, .2, 1); }

.progress {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    z-index: 30;
    background: var(--ink);
    transform: scaleX(0);
    transform-origin: 0 50%;
    pointer-events: none;
}

/* hover: small, springy, never layout */
.cell img, .cell video { transition: transform 1s var(--ease); }
.cell:hover img, .cell:hover video { transform: scale(1.05); }
.cell .tag { transition: transform .45s var(--ease); }
.cell:hover .tag { transform: translateY(-2px); }
.lat .ph img, .lat .ph video { transition: transform 1s var(--ease); }
.lat a:hover .ph img, .lat a:hover .ph video { transform: scale(1.04); }
.row .th img, .row .th video { transition: transform .7s var(--ease); }
.row:hover .th img, .row:hover .th video { transform: scale(1.12); }
.row .ti .t { display: inline-block; transition: transform .5s var(--ease); }
.row:hover .ti .t { transform: translateX(8px); }
.pn b { transition: transform .5s var(--ease); }
.pn a:hover b { transform: translateX(8px); }
.pn a + a:hover b { transform: translateX(-8px); }
.latest a b { transition: transform .5s var(--ease); }
.latest a:hover b { transform: translateX(6px); }
.nav a { background: linear-gradient(currentColor, currentColor) left calc(100% - 1px) / 0 1px no-repeat; transition: background-size .45s var(--ease); }
.nav a:hover { background-size: 100% 1px; text-decoration: none; }
.nav a[aria-current="page"] { text-decoration: none; background-size: 100% 1px; }

@media (prefers-reduced-motion: no-preference) {
    /* ---- from page to page ---- */
    @view-transition { navigation: auto; }
    .top { view-transition-name: top; }                 /* the header stays where it is */
    ::view-transition-group(top) { animation-duration: 0s; }
    ::view-transition-old(root) { animation: vt-out .22s ease both; }
    ::view-transition-new(root) { animation: vt-in .5s var(--ease) both; }
    ::view-transition-group(work-hero) { animation-duration: .7s; animation-timing-function: var(--ease); }
    @keyframes vt-out { to { opacity: 0; } }
    @keyframes vt-in { from { opacity: 0; transform: translate3d(0, 18px, 0); } }

    /* ---- the page arrives, piece by piece ---- */
    .fx [data-in] { animation: in-up 1s var(--ease) backwards; animation-delay: calc(var(--i, 0) * 70ms + 60ms); }
    .fx .home-name[data-in] { animation-name: name-in; animation-duration: 1.2s; }
    .fx .cell[data-in] { animation: tile-in 1.05s var(--ease) backwards; animation-delay: calc(var(--i, 0) * 70ms + 380ms); }
    .fx .cell[data-in] img, .fx .cell[data-in] video { animation: tile-zoom 1.8s var(--ease) backwards; animation-delay: calc(var(--i, 0) * 70ms + 380ms); }
    .fx .hero-frame { animation: hero-in 1.3s var(--ease) backwards; }
    @keyframes in-up { from { opacity: 0; transform: translate3d(0, 28px, 0); } }
    @keyframes name-in { from { opacity: 0; clip-path: inset(0 0 100% 0); transform: translate3d(0, 46px, 0); } to { clip-path: inset(0 0 -12% 0); } }
    @keyframes tile-in { from { clip-path: inset(100% 0 0 0); } to { clip-path: inset(0); } }
    @keyframes tile-zoom { from { transform: scale(1.2); } }
    @keyframes hero-in { from { opacity: 0; clip-path: inset(9% 11% 9% 11%); transform: scale(1.05); } to { opacity: 1; clip-path: inset(0); } }

    /* ---- and rises as it is reached while scrolling: no script, no frame spent on the main thread ---- */
    @supports (animation-timeline: view()) {
        .fx-sda [data-r] { animation: rise linear backwards; animation-timeline: view(); animation-range: entry 0% cover 26%; }
        .fx-sda .hero-frame > :is(img, video) { animation: hero-par linear both; animation-timeline: scroll(root); animation-range: 0 100vh; }
        .fx-sda .progress { display: block; animation: grow linear both; animation-timeline: scroll(root); }
    }
    @keyframes rise { from { opacity: 0; transform: translate3d(0, 36px, 0); } }
    @keyframes hero-par { to { transform: translate3d(0, 3%, 0) scale(1.09); } }
    @keyframes grow { to { transform: scaleX(1); } }

    /* browsers without scroll-driven animations: site.js adds .in as things arrive */
    .fx-io [data-r] { opacity: 0; transform: translate3d(0, 30px, 0); }
    .fx-io [data-r].in { opacity: 1; transform: none; transition: opacity .9s var(--ease), transform 1.1s var(--ease); }
    .fx-io [data-r]:not(.in) { animation: r-failsafe 0s 2.5s forwards; }   /* if the script never comes, show it anyway */
    @keyframes r-failsafe { to { opacity: 1; transform: none; } }
}
