/*
 * book.poppyfounding.fr — copie statique du portfolio cathydolle.com.
 * ---------------------------------------------------------------------------
 * La composition reprend celle du site d'origine : papier clair, encre noire,
 * typographie micro en capitales, deux colonnes de douze projets et une scène
 * d'images au centre. Les images flottent, le curseur devient un carré.
 */

@font-face {
  font-family: 'Neue Montreal';
  src: url('./fonts/neuemontreal-300.otf') format('opentype');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Neue Montreal';
  src: url('./fonts/neuemontreal-400.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Neue Montreal';
  src: url('./fonts/neuemontreal-500.otf') format('opentype');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Neue Montreal';
  src: url('./fonts/neuemontreal-700.otf') format('opentype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #fcfcfc;
  --ink: #0a0a0a;
  --muted: rgba(10, 10, 10, 0.44);
  --line: rgba(10, 10, 10, 0.14);
  --pad: 1.0417vw;
  --micro: clamp(9px, 0.6803vw, 12px);
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --font: 'Neue Montreal', 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  overflow: hidden;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--micro);
  font-weight: 500;
  letter-spacing: 0.005em;
  line-height: 1;
  text-transform: uppercase;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  user-select: none;
  -webkit-user-select: none;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
}

button {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  cursor: pointer;
}

:focus-visible {
  outline: 1px solid var(--ink);
  outline-offset: 4px;
}

/* Le carré qui remplace le curseur n'a de sens qu'à la souris. */
@media (pointer: fine) {
  body,
  button,
  a {
    cursor: none;
  }
}

/* -------------------------------------------------------------------------- */
/* En-tête, pied de page                                                      */
/* -------------------------------------------------------------------------- */

.top,
.foot {
  position: fixed;
  left: 0;
  right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  padding: var(--pad);
}

.top {
  top: 0;
  justify-content: space-between;
}

.foot {
  bottom: 0;
  justify-content: space-between;
}

.brand {
  font-weight: 500;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 63.1vw;
}

.link {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  color: inherit;
  text-transform: uppercase;
}

.link:hover,
.link:focus-visible {
  text-decoration: underline;
  text-underline-offset: 0.35em;
}

.link--quiet {
  color: var(--muted);
}

.sep {
  width: 16px;
  height: 16px;
  object-fit: contain;
}

/* -------------------------------------------------------------------------- */
/* Scène d'images                                                             */
/* -------------------------------------------------------------------------- */

.book {
  position: fixed;
  inset: 0;
}

.stage {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  pointer-events: none;
}

.frame {
  grid-area: 1 / 1;
  width: min(34vw, 82vw);
  max-height: 66vh;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.5s var(--ease);
  will-change: opacity, transform;
}

.frame.is-portrait {
  width: min(22vw, 72vw);
  aspect-ratio: 3 / 4;
}

.frame.is-current {
  opacity: 1;
  pointer-events: auto;
}

body[data-mode='slider'] .frame {
  width: min(52vw, 88vw);
  max-height: 70vh;
}

body[data-mode='slider'] .frame.is-portrait {
  width: min(30vw, 70vw);
}

/* -------------------------------------------------------------------------- */
/* Liste des projets                                                          */
/* -------------------------------------------------------------------------- */

.modes {
  position: fixed;
  top: calc(var(--pad) + 2.4vw);
  left: 16.5vw;
  z-index: 52;
  display: flex;
  gap: 1.6em;
}

.modes .link {
  color: var(--muted);
  transition: color 0.25s var(--ease);
}

.modes .link.is-on,
.modes .link:hover {
  color: var(--ink);
}

.list {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 16.5vw;
  right: 6.4vw;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.0417vw;
  transition: opacity 0.45s var(--ease), visibility 0.45s;
}

body[data-mode='slider'] .list {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.col {
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 32.6vw;
  margin: 0;
  padding: 0;
  list-style: none;
}

.row {
  display: grid;
  grid-template-columns: 7.2vw 1fr;
  align-items: center;
  gap: 1.0417vw;
  width: 100%;
  height: 11vh;
  padding: 0 1.0417vw;
  text-align: left;
  transition: opacity 0.45s var(--ease), color 0.25s var(--ease);
}

.col--right .row {
  grid-template-columns: 1fr 7.2vw;
  text-align: right;
}

.col--right .num {
  order: 2;
}

/* Une ligne survolée s'affirme, les autres s'effacent. */
.list:hover .row {
  opacity: 0.38;
}

.list .row:hover,
.list .row:focus-visible {
  opacity: 1;
}

.num {
  display: block;
  width: 100%;
}

.col--right .num {
  text-align: right;
}

.title {
  display: block;
  font-weight: 500;
  white-space: nowrap;
}

/* -------------------------------------------------------------------------- */
/* Mode slider                                                                */
/* -------------------------------------------------------------------------- */

.slider {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(var(--pad) * 2 + 1.6em);
  z-index: 30;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 0 16.5vw 0 16.5vw;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s var(--ease), visibility 0.4s;
}

body[data-mode='slider'] .slider {
  opacity: 1;
  visibility: visible;
}

.slider__meta {
  display: flex;
  gap: 1.6em;
  align-items: baseline;
}

.slider__nav {
  display: flex;
  gap: 1.6em;
}

.slider__nav .link {
  font-size: calc(var(--micro) * 1.1);
}

/* -------------------------------------------------------------------------- */
/* Curseur carré                                                              */
/* -------------------------------------------------------------------------- */

.crosshair {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 60;
  width: 8px;
  height: 8px;
  border: 1px solid #fff;
  mix-blend-mode: difference;
  pointer-events: none;
  transform: translate3d(-50%, -50%, 0);
  opacity: 0;
  transition: opacity 0.3s var(--ease);
}

body.has-pointer .crosshair {
  opacity: 1;
}

.crosshair__label {
  position: absolute;
  top: 50%;
  left: 16px;
  transform: translateY(-50%);
  clip-path: inset(0 100% 0 0);
  color: #fff;
  font-size: var(--micro);
  font-weight: 500;
  letter-spacing: 0.02em;
  white-space: nowrap;
  transition: clip-path 0.35s var(--ease);
}

body.is-open .crosshair__label {
  clip-path: inset(0 0 0 0);
}

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

.about,
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  clip-path: inset(100% 0 0 0);
  transition: clip-path 0.6s var(--ease);
}

.about[hidden],
.lightbox[hidden] {
  display: none;
}

.about.is-open,
.lightbox.is-open {
  clip-path: inset(0 0 0 0);
}

.about__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--pad);
}

.about__title {
  margin: 0;
  font-weight: 500;
}

.about__body {
  flex: 1;
  display: grid;
  grid-template-columns: 16.5vw minmax(0, 46vw);
  gap: 4vw;
  align-content: center;
  padding: 0 16.5vw 6vw;
  overflow-y: auto;
}

.about__eyebrow {
  grid-column: 1;
  margin: 0;
  color: var(--muted);
}

.about__lede,
.about__text,
.about__facts,
.about__note {
  grid-column: 2;
}

.about__lede,
.about__text {
  margin: 0;
  font-size: clamp(16px, 1.25vw, 21px);
  font-weight: 400;
  letter-spacing: -0.012em;
  line-height: 1.45;
  text-transform: none;
}

.about__text {
  color: var(--muted);
}

.about__facts {
  display: grid;
  gap: 1em;
  margin: 4vw 0 0;
  font-size: var(--micro);
}

.about__facts div {
  display: grid;
  grid-template-columns: 10em 1fr;
  gap: 1em;
  padding-top: 1em;
  border-top: 1px solid var(--line);
}

.about__facts dt {
  color: var(--muted);
}

.about__facts dd {
  display: flex;
  gap: 1.4em;
  margin: 0;
}

.about__note {
  margin: 3vw 0 0;
  color: var(--muted);
  font-size: var(--micro);
  line-height: 1.7;
  text-transform: none;
}

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

.lightbox__figure {
  flex: 1;
  display: grid;
  place-items: center;
  margin: 0;
  padding: var(--pad) var(--pad) 4vw;
  min-height: 0;
}

.lightbox__figure img {
  max-width: 86vw;
  max-height: 100%;
  object-fit: contain;
}

/* -------------------------------------------------------------------------- */
/* Sans JavaScript                                                            */
/* -------------------------------------------------------------------------- */

.noscript {
  position: fixed;
  top: 50%;
  left: 0;
  right: 0;
  z-index: 90;
  margin: 0;
  padding: var(--pad) 16.5vw;
  background: var(--paper);
  font-size: 13px;
  line-height: 1.6;
  text-transform: none;
}

.noscript__list {
  display: none;
}

/* -------------------------------------------------------------------------- */
/* Petit écran : la liste laisse la place à la scène                          */
/* -------------------------------------------------------------------------- */

@media (max-width: 900px) {
  :root {
    --pad: 18px;
    --micro: 11px;
  }

  .nav {
    width: auto;
    gap: 18px;
  }

  .modes,
  .list {
    display: none;
  }

  .frame,
  body[data-mode='slider'] .frame {
    width: 78vw;
    max-height: 64vh;
  }

  .frame.is-portrait,
  body[data-mode='slider'] .frame.is-portrait {
    width: 66vw;
  }

  .slider {
    bottom: calc(var(--pad) * 2 + 1.4em);
    padding: 0 var(--pad);
  }

  .about__body {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 0 18px 96px;
    align-content: start;
  }

  .about__lede {
    font-size: 20px;
  }

  .about__text {
    font-size: 16px;
  }

  .about__facts {
    margin-top: 28px;
  }

  .about__facts div {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .lightbox__figure img {
    max-width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }

  .row {
    transition: none;
  }
}
