/* ==========================================================================
   MIDDLE FRAME — feuille de style
   Papier blanc, encre noire. Les photos font le reste.
   ========================================================================== */

:root {
  --paper: #f7f6f3;
  --ink: #0b0b0b;
  --muted: #6b6a66;
  --line: #d9d7d1;
  --night: #050505;

  --sans: "Instrument Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --display: var(--sans);
  --jp: "Noto Sans JP", "Hiragino Sans", sans-serif;

  --gutter: clamp(16px, 4vw, 56px);
  --header-h: 72px;
  --ease: cubic-bezier(.2, .7, .1, 1);
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }

::selection { background: var(--ink); color: var(--paper); }

:focus-visible { outline: 1px solid currentColor; outline-offset: 4px; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

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

.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  height: var(--header-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 var(--gutter);
  isolation: isolate;
  view-transition-name: site-header;
  transition: color .4s var(--ease);
}
/* Le flou est porté par un pseudo-élément : un backdrop-filter sur l'en-tête
   lui-même piégerait le menu mobile (position: fixed) dans ses 72 px. */
.site-header::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 60%, transparent);
  transition: opacity .4s var(--ease);
}

.brand {
  position: relative; z-index: 2;
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .32em;
  text-transform: uppercase;
  white-space: nowrap;
}
.brand::before { /* petit cadre, en écho au nom */
  content: ""; width: 9px; height: 9px; border: 1.5px solid currentColor;
}

.nav { display: flex; gap: clamp(20px, 3vw, 44px); }

.nav > a {
  position: relative;
  font-size: 12px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color .3s var(--ease);
}
.nav > a:hover, .nav > a[aria-current="page"] { color: var(--ink); }
.nav > a::after {
  content: ""; position: absolute; left: 0; right: .2em; bottom: -6px;
  height: 1px; background: currentColor;
  transform: scaleX(0); transform-origin: right;
  transition: transform .5s var(--ease);
}
.nav > a:hover::after, .nav > a[aria-current="page"]::after { transform: scaleX(1); transform-origin: left; }
.nav .num, .nav-foot { display: none; }

.menu-toggle {
  display: none; position: relative; z-index: 2;
  align-items: center; gap: 12px;
  font-size: 12px; letter-spacing: .2em; text-transform: uppercase;
}
.burger { position: relative; width: 22px; height: 8px; }
.burger i {
  position: absolute; left: 0; right: 0; height: 1.5px; background: currentColor;
  transition: transform .5s var(--ease), top .5s var(--ease);
}
.burger i:first-child { top: 0; }
.burger i:last-child { top: 6.5px; }
.menu-open .burger i:first-child { top: 3.25px; transform: rotate(45deg); }
.menu-open .burger i:last-child { top: 3.25px; transform: rotate(-45deg); }

/* En-tête transparent, texte blanc (accueil) */
.is-dark .site-header { color: #fff; }
.is-dark .site-header::before { opacity: 0; }
.is-dark .nav > a { color: rgba(255, 255, 255, .6); }
.is-dark .nav > a:hover, .is-dark .nav > a[aria-current="page"] { color: #fff; }

/* ---------- Menu mobile plein écran ---------- */
@media (max-width: 720px) {
  .menu-toggle { display: inline-flex; }

  .nav {
    position: fixed; inset: 0; z-index: 1;
    flex-direction: column; justify-content: flex-end; gap: 0;
    padding: calc(var(--header-h) + 24px) var(--gutter) max(28px, env(safe-area-inset-bottom));
    background: var(--night); color: #fff;
    clip-path: inset(0 0 100% 0);
    visibility: hidden;
    transition: clip-path .75s var(--ease), visibility 0s linear .75s;
  }
  .menu-open .nav {
    clip-path: inset(0 0 0 0);
    visibility: visible;
    transition: clip-path .75s var(--ease), visibility 0s;
  }

  .nav > a {
    display: flex; align-items: baseline; gap: 16px;
    padding: 6px 0;
    overflow: hidden;
    font-size: clamp(44px, 14vw, 68px);
    font-weight: 500;
    line-height: 1.02;
    letter-spacing: -.05em;
    text-transform: none;
    color: #fff;
  }
  .is-dark .nav > a { color: #fff; }
  .nav > a::after { display: none; }
  .nav > a[aria-current="page"] .label { color: rgba(255, 255, 255, .38); }

  .nav .num, .nav .label {
    display: block;
    transform: translateY(105%);
    transition: transform .5s var(--ease);
  }
  .nav .num { font-size: 11px; letter-spacing: .12em; color: rgba(255, 255, 255, .45); min-width: 2ch; }
  .menu-open .nav .num, .menu-open .nav .label {
    transform: none;
    transition: transform .9s var(--ease) calc(.22s + var(--i, 0) * .07s);
  }

  .nav-foot {
    display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px;
    margin-top: 44px; padding-top: 18px;
    border-top: 1px solid rgba(255, 255, 255, .16);
    font-size: 11px; letter-spacing: .2em; text-transform: uppercase;
    color: rgba(255, 255, 255, .55);
    opacity: 0; transform: translateY(10px);
    transition: opacity .3s var(--ease), transform .3s var(--ease);
  }
  .nav .nav-foot a { color: #fff; }
  .nav-foot .socials { gap: 8px 20px; }
  .menu-open .nav-foot { opacity: 1; transform: none; transition: opacity .8s var(--ease) .55s, transform .8s var(--ease) .55s; }

  .menu-open .site-header { color: #fff; }
  .menu-open .site-header::before { opacity: 0; }
  html.menu-lock { overflow: hidden; }
}

/* ---------- Mise en page générale ---------------------------------------- */

main { padding-top: var(--header-h); }

.page-intro {
  padding: clamp(56px, 12vh, 140px) var(--gutter) clamp(40px, 7vh, 80px);
  display: grid; gap: 18px;
}

.eyebrow {
  font-size: 11px;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: var(--muted);
}

.title {
  margin: 0;
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(44px, 8vw, 112px);
  line-height: .95;
  letter-spacing: -.045em;
}
.title em { font-style: normal; color: var(--muted); }

.lede {
  max-width: 38ch;
  margin: 0;
  color: var(--muted);
  font-size: 16px;
}

/* ---------- Accueil ------------------------------------------------------- */

.home { background: var(--night); color: #fff; }
.home main { padding: 0; }

.hero {
  position: relative;
  height: 100vh; height: 100svh;
  overflow: hidden;
  background: var(--night);
}

.hero-slides { position: absolute; inset: 0; }

.hero-slide {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.08);
  transition: opacity 1.6s var(--ease), transform 8s cubic-bezier(.25, .1, .25, 1);
}
.hero-slide.is-active { opacity: .9; transform: scale(1); }

/* Voiles pour la lisibilité du texte :
   - en bas, un fondu du noir jusqu'au-dessus de « Middle » (--shade est
     calculé en JS d'après la hauteur réelle du bloc de texte) ;
   - en haut, une bande sombre derrière « Middle Frame » et le menu. */
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(to top,
      rgba(0,0,0,.9) 0,
      rgba(0,0,0,.72) calc(var(--shade, 50%) * .45),
      rgba(0,0,0,.35) calc(var(--shade, 50%) * .78),
      rgba(0,0,0,0) var(--shade, 50%)),
    linear-gradient(to bottom,
      rgba(0,0,0,.7) 0,
      rgba(0,0,0,.4) calc(var(--header-h) + 8px),
      rgba(0,0,0,0) calc(var(--header-h) + 90px));
}

.hero-text {
  position: absolute; z-index: 2;
  left: var(--gutter); bottom: clamp(28px, 7vh, 72px);
  display: grid; gap: 20px;
}

.hero-title {
  margin: 0;
  animation: rise 1.4s var(--ease) both .2s;
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(52px, 11vw, 160px);
  line-height: .88;
  letter-spacing: -.05em;
}

.hero-title em { font-style: normal; color: rgba(255, 255, 255, .86); }

@keyframes rise { from { opacity: 0; transform: translateY(24px); } }

@media (max-width: 720px) {
  .hero-text { right: var(--gutter); bottom: calc(clamp(28px, 7vh, 72px) + 34px); }
  .hero-progress { left: var(--gutter); justify-items: stretch; grid-auto-flow: column; grid-template-columns: 1fr auto; align-items: center; }
  .hero-bars { width: auto; }
}

.hero-link {
  display: inline-flex; align-items: center; gap: 14px;
  width: max-content;
  font-size: 12px; letter-spacing: .28em; text-transform: uppercase;
}
.hero-link span { display: block; width: 44px; height: 1px; background: currentColor; transition: width .5s var(--ease); }
.hero-link:hover span { width: 88px; }

.hero-progress {
  position: absolute; z-index: 2;
  right: var(--gutter); bottom: clamp(28px, 7vh, 72px);
  display: grid; gap: 10px; justify-items: end;
  font-size: 11px; letter-spacing: .2em; font-variant-numeric: tabular-nums;
  color: rgba(255, 255, 255, .7);
}
.hero-bars { display: flex; gap: 6px; width: min(180px, 36vw); }
.hero-bars i { position: relative; flex: 1; height: 1.5px; background: rgba(255, 255, 255, .25); overflow: hidden; }
.hero-bars i::after {
  content: ""; position: absolute; inset: 0; background: #fff;
  transform: scaleX(0); transform-origin: left;
}
.hero-bars i.is-done::after { transform: scaleX(1); }
.hero-bars i.is-active::after { animation: hero-fill var(--hero-dur, 6s) linear forwards; }
@keyframes hero-fill { to { transform: scaleX(1); } }

.hero-jp {
  position: absolute; z-index: 2;
  right: var(--gutter); top: calc(var(--header-h) + 24px);
  writing-mode: vertical-rl;
  font-family: var(--jp);
  font-size: 13px; letter-spacing: .5em;
  color: rgba(255, 255, 255, .7);
}

/* ---------- Galerie (grille) ---------------------------------------------- */

.count {
  margin-left: .15em;
  font-size: .22em; font-weight: 500; letter-spacing: .04em;
  vertical-align: top; position: relative; top: .5em;
  color: var(--muted);
}

.view-switch {
  display: inline-flex; gap: 4px; width: max-content; margin-top: 12px;
  padding: 4px; border: 1px solid var(--line); border-radius: 999px;
}
.view-switch button {
  padding: 7px 16px; border-radius: 999px;
  font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--muted);
  transition: background .3s var(--ease), color .3s var(--ease);
}
.view-switch button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }

/* Sommaire des séries */
.series-nav {
  padding: 0 var(--gutter) clamp(56px, 10vh, 120px);
}
.series-index {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
  margin: 0; padding: 0; list-style: none;
  border-top: 1px solid var(--line);
}
.series-index a {
  display: grid; grid-template-columns: auto 1fr auto; align-items: baseline; gap: 12px;
  padding: 16px 16px 16px 0;
  border-bottom: 1px solid var(--line);
  transition: color .3s var(--ease), padding .4s var(--ease);
}
.series-index a:hover { padding-left: 8px; }
.si-num, .si-count { font-size: 11px; letter-spacing: .14em; color: var(--muted); font-variant-numeric: tabular-nums; }
.si-title { font-size: 17px; font-weight: 500; letter-spacing: -.02em; }

.works {
  --gap: clamp(12px, 2vw, 28px);
  padding: 0 var(--gutter) clamp(80px, 12vh, 160px);
}

/* Une série */
.series { scroll-margin-top: calc(var(--header-h) + 24px); }
.series + .series { margin-top: clamp(96px, 16vh, 200px); }

.series-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  grid-template-areas: "num num" "title text";
  gap: 14px clamp(24px, 5vw, 80px);
  align-items: end;
  margin-bottom: clamp(28px, 5vh, 56px);
  padding-top: 20px;
  border-top: 1px solid var(--ink);
}
.series-num { grid-area: num; font-size: 11px; letter-spacing: .28em; text-transform: uppercase; color: var(--muted); }
.series-title {
  grid-area: title; margin: 0;
  font-size: clamp(40px, 6.5vw, 88px); font-weight: 500;
  line-height: .95; letter-spacing: -.045em;
}
.series-text { grid-area: text; margin: 0; max-width: 46ch; color: var(--muted); font-size: 15px; line-height: 1.65; }

.series-grid { columns: 3 300px; column-gap: var(--gap); }
.works.is-single .series-grid { columns: 1; max-width: 1100px; margin: 0 auto; }
.works.is-single { --gap: clamp(40px, 8vh, 96px); }

@media (max-width: 720px) {
  .series-head { grid-template-columns: 1fr; grid-template-areas: "num" "title" "text"; }
  .series-grid { columns: 2; }
  .works.is-single .series-grid { columns: 1; }
}

.work {
  display: block;
  width: 100%;
  margin: 0 0 var(--gap);
  break-inside: avoid;
  cursor: zoom-in;
  text-align: left;
}
.work-media { display: block; overflow: hidden; background: #e8e6e1; }
.work img {
  width: 100%;
  filter: grayscale(1) contrast(1.02);
  transition: transform 1.4s var(--ease), opacity .8s var(--ease), filter .6s var(--ease);
  opacity: 0;
}
.work img.is-loaded { opacity: 1; }
.work:hover img { transform: scale(1.03); filter: grayscale(1) contrast(1.12); }
.work-num {
  display: flex; justify-content: space-between;
  padding-top: 8px;
  font-size: 10px; letter-spacing: .2em; font-variant-numeric: tabular-nums;
  color: var(--muted);
  opacity: 0; transform: translateY(-4px);
  transition: opacity .4s var(--ease), transform .4s var(--ease);
}
.work:hover .work-num, .works.is-single .work-num { opacity: 1; transform: none; }
@media (hover: none) { .work-num { opacity: 1; transform: none; } }


/* ---------- Visionneuse --------------------------------------------------- */

.lightbox {
  position: fixed; inset: 0; z-index: 100;
  display: grid; grid-template-rows: auto 1fr auto;
  background: var(--night); color: #fff;
  opacity: 0; visibility: hidden;
  transition: opacity .4s var(--ease), visibility .4s;
}
.lightbox.is-open { opacity: 1; visibility: visible; }

.lb-bar {
  display: flex; justify-content: space-between; align-items: center;
  height: var(--header-h); padding: 0 var(--gutter);
  font-size: 12px; letter-spacing: .2em; text-transform: uppercase;
}
.lb-bar button { letter-spacing: inherit; text-transform: inherit; }

.lb-stage {
  position: relative; min-height: 0;
  display: flex; align-items: center; justify-content: center;
  padding: 0 var(--gutter);
}
.lb-stage img {
  max-width: 100%; max-height: 100%;
  width: auto; height: auto;
  object-fit: contain;
  transition: opacity .35s var(--ease);
}
.lb-stage img.is-swapping { opacity: 0; }

.lb-prev, .lb-next {
  position: absolute; top: 0; bottom: 0; width: 40%;
}
.lb-prev { left: 0; cursor: w-resize; }
.lb-next { right: 0; cursor: e-resize; }

.lb-foot {
  display: flex; justify-content: space-between;
  height: var(--header-h); align-items: center; padding: 0 var(--gutter);
  font-size: 12px; letter-spacing: .2em; text-transform: uppercase;
  color: rgba(255, 255, 255, .55);
}

/* ---------- À propos ------------------------------------------------------ */

.about {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: clamp(32px, 7vw, 120px);
  padding: clamp(56px, 12vh, 140px) var(--gutter) clamp(80px, 14vh, 180px);
  align-items: start;
}

.about-figure { margin: 0; position: sticky; top: calc(var(--header-h) + 24px); }
.about-figure img { width: 100%; filter: grayscale(1); }
.about-figure figcaption { margin-top: 12px; font-size: 12px; color: var(--muted); }

.about-body { max-width: 60ch; }
.about-body .title { margin: 18px 0 clamp(36px, 6vh, 64px); }

.prose p { margin: 0 0 1.35em; font-size: 17px; line-height: 1.75; }
.prose .opening { font-size: clamp(22px, 2.2vw, 28px); font-weight: 500; line-height: 1.35; letter-spacing: -.01em; }

/* « Un geste. Un regard. … » */
.litany {
  margin: clamp(36px, 6vh, 64px) 0;
  padding: 0 0 0 24px;
  border-left: 1px solid var(--ink);
  list-style: none;
  font-size: clamp(24px, 2.6vw, 34px);
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -.02em;
}
.litany li:not(:last-child) { color: var(--muted); }

.closing { font-weight: 500; }

.influences-label { display: block; margin-top: clamp(48px, 8vh, 88px); }

.influences { margin: 16px 0 0; border-top: 1px solid var(--line); }
.influences div {
  display: flex; justify-content: space-between; gap: 16px;
  padding: 14px 0; border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.influences dt { font-weight: 500; }
.influences dd { margin: 0; color: var(--muted); font-family: var(--jp); }

@media (max-width: 860px) {
  .about { grid-template-columns: 1fr; }
  .about-figure { position: static; }
}

/* ---------- Boutique ------------------------------------------------------ */

.shop {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
  gap: clamp(48px, 6vw, 88px) clamp(16px, 3vw, 44px);
  padding: 0 var(--gutter) clamp(64px, 10vh, 120px);
}

.product { display: grid; gap: 18px; align-content: start; }

.product-frame {
  aspect-ratio: 4 / 5;
  display: flex; align-items: center; justify-content: center;
  padding: 11%;
  background: #ebe9e4;
  cursor: zoom-in;
}
.product-frame img {
  /* width/height auto + max-* : l'image garde ses proportions (portrait compris) */
  width: auto; height: auto;
  max-width: 100%; max-height: 100%;
  object-fit: contain;
  box-shadow: 0 1px 2px rgba(0,0,0,.12), 0 18px 36px -18px rgba(0,0,0,.45);
  filter: grayscale(1);
  transition: transform .9s var(--ease);
}
.product:hover .product-frame img { transform: translateY(-4px); }

.product-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.product-title { margin: 0; font-family: var(--display); font-weight: 500; font-size: 22px; line-height: 1.15; letter-spacing: -.02em; }
.product-price { font-size: 15px; font-variant-numeric: tabular-nums; }
.product-meta { margin: 0; font-size: 13px; color: var(--muted); }

.formats { display: flex; flex-wrap: wrap; gap: 8px; border: 0; margin: 0; padding: 0; }
.formats label { position: relative; }
.formats input { position: absolute; opacity: 0; pointer-events: none; }
.formats span {
  display: grid; gap: 2px; padding: 9px 14px;
  border: 1px solid var(--line);
  font-size: 12px; letter-spacing: .06em;
  cursor: pointer;
  transition: border-color .2s, background .2s, color .2s;
}
.formats span strong { font-weight: 500; }
.formats span small { font-size: 10.5px; letter-spacing: .04em; opacity: .65; }
.formats input:checked + span { border-color: var(--ink); background: var(--ink); color: var(--paper); }

.currency-switch {
  display: inline-flex; gap: 4px; width: max-content; margin-top: 12px;
  padding: 4px; border: 1px solid var(--line); border-radius: 999px;
}
.currency-switch button {
  padding: 7px 16px; border-radius: 999px;
  font-size: 11px; letter-spacing: .16em; color: var(--muted);
  transition: background .3s var(--ease), color .3s var(--ease);
}
.currency-switch button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.formats input:focus-visible + span { outline: 1px solid var(--ink); outline-offset: 3px; }

.buy {
  display: flex; justify-content: space-between; align-items: center;
  width: 100%; padding: 15px 18px;
  border: 1px solid var(--ink);
  font-size: 12px; letter-spacing: .24em; text-transform: uppercase;
  transition: background .3s var(--ease), color .3s var(--ease);
}
.buy:hover { background: var(--ink); color: var(--paper); }

.shop-info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: 32px;
  margin: 0 var(--gutter) clamp(80px, 12vh, 160px);
  padding-top: 40px;
  border-top: 1px solid var(--line);
}
.shop-info h3 { margin: 0 0 10px; font-size: 11px; font-weight: 500; letter-spacing: .28em; text-transform: uppercase; }
.shop-info p { margin: 0; font-size: 14px; color: var(--muted); max-width: 36ch; }
.shop-info a { border-bottom: 1px solid var(--line); }

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

.site-footer {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 24px;
  padding: 40px var(--gutter);
  border-top: 1px solid var(--line);
  font-size: 12px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted);
}
.socials { display: flex; flex-wrap: wrap; gap: 8px 28px; margin: 0; padding: 0; list-style: none; }
.socials a, .site-footer .mail { color: var(--ink); transition: opacity .2s; }
.socials a:hover, .site-footer .mail:hover { opacity: .5; }

.hero .socials { font-size: 11px; letter-spacing: .2em; text-transform: uppercase; }
.hero .socials a { color: rgba(255, 255, 255, .7); }
.hero .socials a:hover { color: #fff; opacity: 1; }

/* ---------- Apparition au défilement ---------------------------------------- */

.reveal { opacity: 0; transform: translateY(18px); transition: opacity 1s var(--ease), transform 1s var(--ease); }
.reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
  .reveal { opacity: 1; transform: none; }
}

/* ---------- Transitions entre pages (navigateurs compatibles) ---------------- */

@view-transition { navigation: auto; }
::view-transition-old(root) { animation: vt-out .35s var(--ease) both; }
::view-transition-new(root) { animation: vt-in .6s var(--ease) both; }
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; transform: translateY(12px); } }
