/* Ludovic Fleury — sidebar + content layout. Tactic for titles, Space Grotesk for text (as fleurstudio.work). */

@font-face { font-family: 'Space Grotesk'; font-style: normal; font-weight: 300 700; font-display: swap;
  src: url('/assets/fonts/space-grotesk-latin.cbee7234.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Space Grotesk'; font-style: normal; font-weight: 300 700; font-display: swap;
  src: url('/assets/fonts/space-grotesk-latin-ext.1efa8776.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
/* Tactic has no accented capitals: build.mjs strips accents from text set in it */
@font-face { font-family: 'Tactic'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('/assets/fonts/tactic.d31ea72e.otf') format('opentype'); }

:root {
  color-scheme: light;
  --bg: #f2f2f2;
  --ink: #000;
  --mute: #6e6e6e;
  --rule: 1px solid var(--ink);
  --display: 'Tactic', 'Archivo', 'Arial Narrow', sans-serif;
  --text: 'Space Grotesk', system-ui, sans-serif;

  --gutter: 20px;
  --side: clamp(180px, 13vw, 220px);

  --fs-headline: clamp(20px, 1.7vw, 26px);
  --fs-title: 16px;
  --fs-read: 14px;
  --fs-body: 13px;
  --fs-small: 12px;
  --fs-label: 11px;
  --lh: 1.32;

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
}
@media (max-width: 899px) { :root { --gutter: 14px; --fs-body: 14px; --fs-read: 15px; --fs-small: 12px; } }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--bg); }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 var(--fs-body)/var(--lh) var(--text);
  font-kerning: normal;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; }
/* Links carry no underline; a 1px line draws in from the left on hover, and stays on the current page */
.prose a, .lede a, .contact a, .cv a, .tabs a, .side__projects a, .rows__main, .pager a, .more a, .slide__project, .lang, .pf__toc a {
  background: linear-gradient(currentColor, currentColor) no-repeat 0 100% / 0 1px;
}
[aria-current="page"], .side__projects [aria-current="page"] { background-size: 100% 1px; }
em { font-style: italic; }
img { display: block; max-width: 100%; height: auto; }
/* images can't be dragged out, selected or long-pressed to save (iOS) */
img { -webkit-user-drag: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
h1, h2, h3, p, ul, dl, dd, figure { margin: 0; padding: 0; }
ul { list-style: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
::selection { background: var(--ink); color: var(--bg); }
:focus-visible { outline: 1px solid var(--ink); outline-offset: 3px; }
main:focus { outline: none; }

.skip {
  position: fixed; top: 8px; left: 8px; z-index: 100;
  padding: 6px 12px; background: var(--ink); color: var(--bg);
  transform: translateY(-200%);
}
.skip:focus { transform: none; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}

/* ---------- type roles ---------- */

.title, .headline, .tabs a, .slide__project, .lang, .pf__toc a {
  font-family: var(--display);
  font-weight: 400;
  text-transform: uppercase;
  font-synthesis: none;
}
.headline { font-size: var(--fs-headline); line-height: 0.95; letter-spacing: -0.02em; }
.title { font-size: var(--fs-title); line-height: 1; letter-spacing: -0.01em; }
.title--sub { margin-top: 40px; }
.cv .title--sub { margin-top: 26px; }
.sup {
  font-family: var(--text);
  font-size: var(--fs-small);
  letter-spacing: 0;
  vertical-align: top;
  margin-left: 0.3em;
}
.lede { font-size: var(--fs-read); line-height: var(--lh); max-width: 80ch; }
.prose { font-size: var(--fs-read); line-height: var(--lh); max-width: 110ch; }
.prose p + p { margin-top: 0.6em; }
.prose--gap { margin-top: 3.2em; }

/* ---------- layout ---------- */

@media (min-width: 900px) {
  body { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); }
  .side {
    position: sticky;
    top: 0;
    height: 100vh;
    height: 100dvh;
    overflow-y: auto;
    scrollbar-width: none;
    padding: var(--gutter);
  }
  main { padding: var(--gutter); min-width: 0; }
}

/* ---------- sidebar ---------- */

.logo { display: block; width: min(100%, 132px); }
.logo img { width: 100%; }

.tabs { margin-top: 22px; }
.tabs li + li { margin-top: 1px; }
.tabs a {
  display: inline-block;
  font-size: 12px;
  line-height: 1;
  letter-spacing: 0.04em;
  padding: 3px 0;
}


.lang { display: inline-block; margin-top: 18px; font-size: 11px; letter-spacing: 0.06em; padding: 4px 0; }
.side__list { margin-top: 36px; }
.side__projects { font-size: var(--fs-body); line-height: var(--lh); font-style: italic; }
.side__projects a, .side__projects .is-off { display: inline; }
.side__projects li + li { margin-top: 2px; }
.side__projects .is-off { color: var(--mute); }

/* ---------- home slideshow ---------- */

.slides {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  height: calc(100dvh - var(--gutter) * 2);
  min-height: 420px;
}
.slides__track { position: relative; min-height: 0; }
.slide {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 10px;
}
.slide[hidden] { display: none; }
.slide__link { display: flex; min-height: 0; justify-content: center; }
.slide__link picture { display: contents; }
.slide__link source { display: none; }
.slide__link img {
  width: auto;
  height: 100%;
  max-width: 100%;
  object-fit: contain;
  object-position: center;
}
.slide figcaption {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 14px;
  font-size: var(--fs-small);
  line-height: 1.3;
}
.slide__project { font-size: 12px; letter-spacing: 0.04em; }
.slides__ui {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 4px;
  padding-top: 8px;
  font-size: var(--fs-small);
  font-variant-numeric: tabular-nums;
}
.slides__btn { width: 44px; height: 44px; display: grid; place-items: center; font-size: 18px; }

/* ---------- sheets (about, cv, press, texts, portfolio) ---------- */

.sheet { max-width: 1400px; padding-bottom: 80px; }
.sheet > .title:first-child { margin-bottom: 28px; }

.contact {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 6px 24px;
  margin-top: 18px;
  font-size: var(--fs-read);
}
.contact dt { color: var(--mute); }

.cv .title--sub { margin-bottom: 10px; }
.cv__year {
  display: grid;
  grid-template-columns: 4.5em 1fr;
  gap: 16px;
  padding: 10px 0;
  border-top: var(--rule);
}
.cv__year h3 { font-weight: 400; font-variant-numeric: tabular-nums; }
.cv__year li + li { margin-top: 2px; }
.cv__go { color: var(--mute); }

.rows { border-top: var(--rule); margin-top: 8px; }
.rows li { border-bottom: var(--rule); }
.rows__row {
  display: grid;
  grid-template-columns: 4.5em minmax(0, 1fr) auto;
  gap: 16px;
  padding: 10px 0;
  align-items: baseline;
}
.rows__year { font-variant-numeric: tabular-nums; }
.rows__meta { color: var(--mute); font-size: var(--fs-small); }

.text-entry { scroll-margin-top: 20px; }
.text-entry .title--sub { margin-bottom: 16px; }
.more { margin-top: 14px; }

.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill {
  display: inline-block;
  margin-top: 16px;
  padding: 10px 18px;
  border: var(--rule);
  border-radius: 999px;
}

/* ---------- portfolio ---------- */

.pf { padding-bottom: 80px; }
.pf__head { max-width: 900px; padding-bottom: 28px; }
.pf__head .title { margin-bottom: 18px; }
.pf__toc { display: flex; flex-wrap: wrap; gap: 6px 22px; margin-top: 18px; }
.pf__toc a { font-size: 12px; letter-spacing: 0.04em; }
.pf-series { padding-top: 28px; margin-top: 28px; border-top: var(--rule); scroll-margin-top: 12px; }
.pf-series__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 8px 24px; margin-bottom: 20px; }
.pf-series > .prose { margin-bottom: 48px; }
.pf-page {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  align-items: end;
  max-width: 900px;
  margin-bottom: 14px;
}
.pf-page--two { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: none; }
.pf-page .work { margin: 0; }
.pf-quote { grid-column: 1 / -1; max-width: 34em; margin: 32px 0 18px; font-size: var(--fs-read); line-height: var(--lh); }
.pf-quote footer { margin-top: 8px; color: var(--mute); font-size: var(--fs-small); }

/* ---------- project pages ---------- */

.project { padding-bottom: 60px; }
.project__head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px 24px;
  padding-bottom: 14px;
  border-bottom: var(--rule);
}
.project__meta { font-size: var(--fs-small); color: var(--mute); }

.gallery { max-width: 900px; margin-top: 28px; }
.work { margin-bottom: 14px; }
.work__open { display: block; width: 100%; overflow: hidden; cursor: zoom-in; }
.work img { width: 100%; background: var(--ph, #e4e4e4); }
/* a whole work fits on screen: cap the height, keep the ratio */
.gallery .work img, .pf-page .work img {
  width: auto;
  max-width: 100%;
  max-height: calc(100vh - var(--gutter) * 4);
  max-height: calc(100dvh - var(--gutter) * 4);
}
.gallery .work__open, .pf-page .work__open { width: fit-content; max-width: 100%; }
.work figcaption { margin-top: 6px; font-size: var(--fs-small); line-height: 1.35; max-width: 60ch; }

.project__text { padding-top: 24px; border-top: var(--rule); }

.pager {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 48px;
  padding-top: 10px;
  border-top: var(--rule);
  font-size: var(--fs-small);
}

/* ---------- lightbox ---------- */

.lb {
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: var(--bg);
  color: var(--ink);
}
.lb::backdrop { background: var(--bg); }
.lb__stage {
  position: absolute;
  inset: 0 0 auto 0;
  height: calc(100% - 4.5em);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 64px 0;
}
.lb__stage picture { display: contents; }
.lb__stage source { display: none; }
.lb__stage img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }
.lb__caption {
  position: absolute;
  inset: auto var(--gutter) calc(14px + env(safe-area-inset-bottom));
  font-size: var(--fs-small);
  line-height: 1.35;
  display: flex;
  justify-content: space-between;
  gap: 2em;
}
.lb__count { flex: none; font-variant-numeric: tabular-nums; }
.lb__btn { position: absolute; display: grid; place-items: center; width: 44px; height: 44px; font-size: 18px; }
.lb__close { top: 8px; right: calc(var(--gutter) - 12px); font-size: 22px; }
.lb__prev { top: 50%; left: calc(var(--gutter) - 12px); margin-top: -22px; }
.lb__next { top: 50%; right: calc(var(--gutter) - 12px); margin-top: -22px; }

/* ---------- small screens ---------- */

@media (max-width: 899px) {
  body { display: flex; flex-direction: column; }
  .side { display: contents; }
  .side__head {
    order: 1;
    position: sticky;
    top: 0;
    z-index: 10;
    padding: calc(10px + env(safe-area-inset-top)) max(var(--gutter), env(safe-area-inset-right)) 4px max(var(--gutter), env(safe-area-inset-left));
    background: var(--bg);
    border-bottom: var(--rule);
  }
  .logo { width: 120px; }
  .tabs { margin-top: 10px; }
  .tabs ul { display: flex; flex-wrap: wrap; gap: 0 18px; }
  .tabs li + li { margin-top: 0; }
  /* comfortable touch targets */
  .tabs a { padding: 16px 0 15px; }
  .side__projects a { display: inline-block; padding: 8px 0; }
  .side__projects li + li { margin-top: 0; }
  .pager a, .more a, .cv__link { padding-block: 6px; display: inline-block; }
  /* the sticky header takes ~90px: keep a whole work visible under it */
  .gallery .work img, .pf-page .work img { max-height: calc(100svh - 130px); }
  main { order: 2; padding: 20px max(var(--gutter), env(safe-area-inset-right)) 0 max(var(--gutter), env(safe-area-inset-left)); }
  .side__list { order: 3; margin: 32px var(--gutter) 40px; }
  .slides { height: 70vh; height: 70svh; min-height: 320px; }
  .project__head .headline, .pf-series .headline { font-size: 22px; }
  .pf-page--two { grid-template-columns: minmax(0, 1fr); }
  .lang { position: absolute; top: calc(4px + env(safe-area-inset-top)); right: max(var(--gutter), env(safe-area-inset-right)); margin: 0; padding: 12px 0 12px 16px; }
  .rows__row, .cv__year { grid-template-columns: 3.2em minmax(0, 1fr) auto; gap: 12px; }
  .cv__year { grid-template-columns: 3.2em 1fr; }
  .lb__stage { padding: 56px 8px 0; }
  .lb__prev, .lb__next { display: none; }
}

/* ---------- motion ---------- */

/* Page change: the sidebar stays put, the old page leaves at once, the new content rises in */
@view-transition { navigation: auto; }
::view-transition-old(root),
::view-transition-new(root) { animation: none; }

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
}
.js main > * > * {
  animation: rise 520ms var(--ease-out) both;
}
.js main > * > :nth-child(2) { animation-delay: 50ms; }
.js main > * > :nth-child(3) { animation-delay: 100ms; }
.js main > * > :nth-child(4) { animation-delay: 150ms; }
.js main > * > :nth-child(n + 5) { animation-delay: 200ms; }

/* sidebar items arrive once, on the first page of the visit (see site.js) */
.is-first .tabs li, .is-first .side__projects li { animation: rise 520ms var(--ease-out) both; }
.is-first .tabs li:nth-child(2) { animation-delay: 30ms; }
.is-first .tabs li:nth-child(3) { animation-delay: 60ms; }
.is-first .tabs li:nth-child(4) { animation-delay: 90ms; }
.is-first .tabs li:nth-child(5) { animation-delay: 120ms; }
.is-first .side__projects li { animation-delay: 180ms; }
.is-first .side__projects li:nth-child(2) { animation-delay: 210ms; }
.is-first .side__projects li:nth-child(3) { animation-delay: 240ms; }
.is-first .side__projects li:nth-child(4) { animation-delay: 270ms; }
/* the sidebar is the same on every page: keep it still */
.side__head { view-transition-name: side-head; }
.side__list { view-transition-name: side-list; }

.js .work img { opacity: 0; transition: opacity 400ms var(--ease-out); }
.js .work img.is-loaded { opacity: 1; }

.slide { transition: opacity 240ms ease; }
.slide.is-entering { opacity: 0; }

.lb { opacity: 0; transition: opacity 200ms var(--ease-out), display 200ms allow-discrete, overlay 200ms allow-discrete; }
.lb[open] { opacity: 1; }
@starting-style { .lb[open] { opacity: 0; } }
.lb .lb__stage img { transition: transform 240ms var(--ease-out); }
.lb:not([open]) .lb__stage img { transform: scale(0.97); }
@starting-style { .lb[open] .lb__stage img { transform: scale(0.97); } }

.preview {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 8;
  width: clamp(160px, 16vw, 260px);
  pointer-events: none;
  opacity: 0;
  transition: opacity 150ms ease;
}
.preview.is-on { opacity: 1; }
.preview img { width: 100%; background: var(--ph, #e4e4e4); }

@media (hover: hover) and (pointer: fine) {
  .prose a, .lede a, .contact a, .cv a, .tabs a, .side__projects a, .rows__main, .pager a, .more a, .slide__project, .lang, .pf__toc a {
    transition: background-size 320ms var(--ease-out);
  }
  a:hover, a:hover .rows__main { background-size: 100% 1px; }
  .slides__btn { transition: opacity 150ms ease; }
  .slides__btn:hover { opacity: 0.5; }
  .work__open img { transition: opacity 400ms var(--ease-out), transform 600ms var(--ease-out); }
  .work__open:hover img.is-loaded { transform: scale(1.006); }
}

@media (prefers-reduced-motion: reduce) {
  @keyframes rise { from { opacity: 0; } }
  .work__open:hover img.is-loaded { transform: none; }
  .lb .lb__stage img { transition: none; transform: none !important; }
  .preview { display: none; }
}
