/* Serge Coulas — Rêvographies
   Papier, silence, photographie. Rien d’autre. */

:root {
  --ivory: #f4f1ea;
  --ink: #171715;
  --mute: #77736b;
  --white: #ffffff;
  --night: #11110f;
  --hairline: rgba(23, 23, 21, 0.12);
  --hairline-light: rgba(244, 241, 234, 0.16);
  --serif: "Cormorant Garamond", "Times New Roman", Times, serif;
  --sans: "Inter", system-ui, sans-serif;
  --space: clamp(1.5rem, 5vw, 4.5rem);
  --space-s: clamp(1rem, 3vw, 2rem);
  --breath: clamp(4.5rem, 18vh, 11rem);
  --measure: 34rem;
  --page: min(92vw, 1440px);
  --nav-h: 4.5rem;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--ivory);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  min-height: 100dvh;
  overflow-x: clip;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
  vertical-align: middle;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea,
select,
label {
  font-family: inherit;
}

:focus-visible {
  outline: 1px solid currentColor;
  outline-offset: 4px;
}

.skip-link {
  position: absolute;
  left: max(1rem, var(--safe-l));
  top: -3rem;
  z-index: 80;
  background: var(--ink);
  color: var(--ivory);
  padding: 0.5rem 0.9rem;
  font-size: 0.8125rem;
}

.skip-link:focus {
  top: calc(0.75rem + var(--safe-t));
}

.page-night {
  background: var(--night);
  color: var(--ivory);
}

.page-night {
  --hairline: var(--hairline-light);
}

/* —— Pierre —— */
.stone {
  display: block;
  width: 4px;
  height: 4px;
  margin: 0 0 1.5rem;
  background: currentColor;
  opacity: 0.38;
}

/* —— Nav —— */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: var(--nav-h);
  padding: calc(0.6rem + var(--safe-t)) max(var(--space-s), var(--safe-r)) 0.6rem
    max(var(--space-s), var(--safe-l));
  color: var(--ink);
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background 0.5s var(--ease), border-color 0.5s var(--ease),
    color 0.5s var(--ease);
}

.nav.is-solid,
.page-inner .nav {
  background: var(--ivory);
  border-bottom-color: var(--hairline);
}

.page-night .nav.is-solid,
.page-night.page-inner .nav {
  background: var(--night);
  color: var(--ivory);
}

.page-entry .nav:not(.is-solid) {
  color: var(--ivory);
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  line-height: 1.15;
  z-index: 52;
  flex-shrink: 0;
}

.brand-name {
  font-size: 0.625rem;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
}

.brand-mark {
  font-family: var(--serif);
  font-size: 1.05rem;
  font-weight: 400;
  letter-spacing: 0.06em;
  font-style: normal;
}

.menu-list {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.15rem 1.35rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.menu-list a {
  font-size: 0.6875rem;
  font-weight: 400;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  opacity: 0.62;
  padding: 0.45rem 0;
  transition: opacity 0.4s var(--ease);
}

.menu-list a:hover,
.menu-list a[aria-current="page"] {
  opacity: 1;
}

.nav-toggle {
  display: none;
  width: 2.75rem;
  height: 2.75rem;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  position: relative;
  z-index: 52;
  cursor: pointer;
}

.nav-toggle span {
  position: absolute;
  left: 0.8rem;
  right: 0.8rem;
  height: 1px;
  background: currentColor;
  transition: transform 0.4s var(--ease), top 0.4s var(--ease);
}

.nav-toggle span:first-child {
  top: 1.15rem;
}

.nav-toggle span:last-child {
  top: 1.55rem;
}

.nav.is-open .nav-toggle span:first-child {
  top: 1.35rem;
  transform: rotate(45deg);
}

.nav.is-open .nav-toggle span:last-child {
  top: 1.35rem;
  transform: rotate(-45deg);
}

/* —— Entrée —— */
.entry {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: flex-end;
  color: var(--ivory);
  background: var(--night);
}

.entry-media {
  position: absolute;
  inset: 0;
}

.entry-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 45%;
  opacity: 0;
  animation: fadeIn 1.8s var(--ease) 0.15s forwards;
}

.entry-veil {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(17, 17, 15, 0.28) 0%,
    rgba(17, 17, 15, 0.08) 42%,
    rgba(17, 17, 15, 0.55) 100%
  );
  pointer-events: none;
}

.entry-inner {
  position: relative;
  z-index: 1;
  width: 100%;
  padding: 0 var(--space) clamp(3.5rem, 8vh, 5.5rem);
}

.entry-name {
  margin: 0 0 0.35rem;
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.38em;
  text-transform: uppercase;
  opacity: 0;
  animation: rise 1.2s var(--ease) 0.5s forwards;
}

.entry-universe {
  margin: 0 0 1.75rem;
  font-family: var(--serif);
  font-size: clamp(1.65rem, 3.2vw, 2.35rem);
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  line-height: 1.15;
  opacity: 0;
  animation: rise 1.2s var(--ease) 0.75s forwards;
}

.entry-invite {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(1.25rem, 2.2vw, 1.6rem);
  font-style: italic;
  font-weight: 400;
  opacity: 0;
  animation: rise 1.2s var(--ease) 1.05s forwards;
}

.entry-invite a {
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 0 1px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  transition: background-size 0.6s var(--ease);
}

.entry-invite a:hover {
  background-size: 100% 1px;
}

.entry-hint {
  position: absolute;
  right: var(--space);
  bottom: calc(2rem + var(--safe-b));
  z-index: 1;
  font-size: 0.625rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  opacity: 0.55;
  writing-mode: vertical-rl;
}

@keyframes fadeIn {
  to {
    opacity: 1;
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* —— Mise en page —— */
.wrap {
  width: var(--page);
  margin-inline: auto;
}

.main {
  padding-top: var(--nav-h);
}

.page-entry .main {
  padding-top: 0;
}

.chapter {
  padding: clamp(4rem, 12vh, 8rem) 0 var(--breath);
}

.chapter-kicker {
  margin: 0 0 0.75rem;
  font-size: 0.6875rem;
  font-weight: 400;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--mute);
}

.chapter-title {
  margin: 0 0 1.25rem;
  font-family: var(--serif);
  font-size: clamp(2.4rem, 6vw, 4.4rem);
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: -0.01em;
}

.chapter-lead {
  margin: 0;
  max-width: 28rem;
  font-family: var(--serif);
  font-size: clamp(1.2rem, 2vw, 1.45rem);
  font-weight: 400;
  line-height: 1.45;
  color: var(--mute);
}

.breath {
  height: var(--breath);
}

.breath--s {
  height: clamp(2.5rem, 10vh, 5.5rem);
}

.verse {
  width: min(100%, var(--measure));
  margin: 0 auto;
  padding: 0 var(--space-s);
  font-family: var(--serif);
  font-size: clamp(1.2rem, 2.1vw, 1.5rem);
  line-height: 1.55;
  text-align: center;
}

.verse p {
  margin: 0 0 1.1em;
}

.verse p:last-child {
  margin-bottom: 0;
}

.whisper {
  width: min(100%, 22rem);
  margin: 0 auto;
  padding: 0 var(--space-s);
  font-family: var(--serif);
  font-size: clamp(1.15rem, 1.8vw, 1.35rem);
  font-style: italic;
  line-height: 1.5;
  text-align: center;
  color: var(--mute);
}

.whisper p {
  margin: 0;
}

.colophon {
  width: min(100%, var(--measure));
  margin: 0 auto;
  padding: 0 var(--space);
  font-size: 0.9375rem;
  color: var(--mute);
  line-height: 1.7;
}

.colophon p {
  margin: 0 0 1em;
}

.colophon p:last-child {
  margin-bottom: 0;
}

/* —— Plaques photographiques —— */
.plate {
  margin: 0;
  padding: 0;
}

.plate img {
  width: 100%;
  height: auto;
  background: rgba(23, 23, 21, 0.06);
}

.page-night .plate img {
  background: rgba(244, 241, 234, 0.06);
}

.plate--bleed {
  width: 100%;
}

.plate--bleed img {
  width: 100%;
  max-height: 100dvh;
  object-fit: cover;
}

.plate--wide {
  width: min(88vw, 1280px);
  margin-inline: auto;
}

.plate--page {
  width: min(72vw, 980px);
  margin-inline: auto;
}

.plate--narrow {
  width: min(48vw, 640px);
  margin-inline: auto;
}

.plate--small {
  width: min(34vw, 420px);
  margin-inline: auto;
}

.plate--left {
  width: min(58vw, 820px);
  margin-left: var(--space);
  margin-right: auto;
}

.plate--right {
  width: min(58vw, 820px);
  margin-right: var(--space);
  margin-left: auto;
}

.plate figcaption {
  margin-top: 0.85rem;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  color: var(--mute);
}

.is-mono img {
  filter: grayscale(1);
}

/* —— Sommaire —— */
.sommaire {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(2rem, 6vw, 5rem);
  align-items: center;
  width: var(--page);
  margin: 0 auto;
  padding: clamp(3rem, 10vh, 6rem) 0 var(--breath);
}

.sommaire-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sommaire-list li + li {
  margin-top: clamp(1.4rem, 3.5vh, 2.4rem);
}

.sommaire-list a {
  display: grid;
  grid-template-columns: 2.4rem 1fr;
  gap: 0.85rem;
  align-items: baseline;
  transition: opacity 0.45s var(--ease);
}

.sommaire-list a:hover,
.sommaire-list a.is-active {
  opacity: 1;
}

.sommaire-list a:not(.is-active):not(:hover) {
  opacity: 0.55;
}

.sommaire-num {
  font-size: 0.6875rem;
  letter-spacing: 0.16em;
  color: var(--mute);
}

.sommaire-name {
  font-family: var(--serif);
  font-size: clamp(1.55rem, 3vw, 2.15rem);
  line-height: 1.15;
}

.sommaire-note {
  grid-column: 2;
  margin: 0.25rem 0 0;
  font-size: 0.8125rem;
  color: var(--mute);
  max-width: 22rem;
}

.sommaire-plate {
  position: relative;
  min-height: min(62vh, 640px);
  overflow: hidden;
}

.sommaire-plate img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.9s var(--ease);
}

.sommaire-plate img.is-on {
  opacity: 1;
}

/* —— Suite —— */
.continue {
  text-align: center;
  padding: 0 var(--space) var(--breath);
}

.continue a {
  font-family: var(--serif);
  font-size: 1.25rem;
  font-style: italic;
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 0 1px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  transition: background-size 0.55s var(--ease);
}

.continue a:hover {
  background-size: 100% 1px;
}

.work-nav {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  width: var(--page);
  margin: 0 auto;
  padding: 0 0 var(--breath);
  font-family: var(--serif);
  font-size: 1.15rem;
  font-style: italic;
}

.work-nav a {
  opacity: 0.7;
  transition: opacity 0.4s var(--ease);
}

.work-nav a:hover {
  opacity: 1;
}

.work-nav .next {
  margin-left: auto;
  text-align: right;
}

/* —— Serge —— */
.essay {
  width: min(100%, 40rem);
  margin: 0 auto;
  padding: 0 var(--space) var(--breath);
}

.essay p {
  font-family: var(--serif);
  font-size: clamp(1.15rem, 1.8vw, 1.35rem);
  line-height: 1.7;
  margin: 0 0 1.35em;
}

.essay p:last-child {
  margin-bottom: 0;
}

/* —— Livres / tirages —— */
.object {
  width: var(--page);
  margin: 0 auto;
  padding-bottom: var(--breath);
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}

.object-copy h2 {
  margin: 0 0 0.85rem;
  font-family: var(--serif);
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
  font-weight: 400;
  line-height: 1.15;
}

.object-copy p {
  margin: 0 0 1em;
  color: var(--mute);
  max-width: 28rem;
}

.object-copy a {
  font-family: var(--serif);
  font-style: italic;
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 0 1px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  transition: background-size 0.55s var(--ease);
}

.object-copy a:hover {
  background-size: 100% 1px;
}

.meta {
  list-style: none;
  margin: 1.5rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
  font-size: 0.8125rem;
}

.meta li {
  display: grid;
  grid-template-columns: 7.5rem 1fr;
  gap: 0.75rem;
  border-top: 1px solid var(--hairline);
  padding-top: 0.55rem;
}

.meta span {
  color: var(--mute);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.6875rem;
}

.price {
  font-family: var(--serif);
  font-size: 1.15rem;
  color: var(--mute);
}

.editions {
  width: var(--page);
  margin: 0 auto;
  padding-bottom: var(--breath);
  display: grid;
  gap: clamp(3rem, 8vh, 5rem);
}

/* —— Correspondances —— */
.letter {
  width: min(100%, 40rem);
  margin: 0 auto;
  padding: 0 var(--space) var(--breath);
}

.letter-lead {
  font-family: var(--serif);
  font-size: 1.3rem;
  line-height: 1.5;
  color: var(--mute);
  margin: 0 0 2.5rem;
}

.field {
  display: grid;
  gap: 0.45rem;
  margin-bottom: 1.35rem;
}

.field label {
  font-size: 0.6875rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--mute);
}

.field input,
.field textarea,
.field select {
  width: 100%;
  padding: 0.7rem 0;
  border: 0;
  border-bottom: 1px solid var(--hairline);
  background: transparent;
  color: inherit;
  font-size: 1rem;
  border-radius: 0;
  appearance: none;
}

.field textarea {
  min-height: 8rem;
  resize: vertical;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: none;
  border-bottom-color: currentColor;
}

.send {
  margin-top: 1.5rem;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0.5rem 0;
  font-family: var(--serif);
  font-size: 1.25rem;
  font-style: italic;
  cursor: pointer;
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 0 1px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  transition: background-size 0.55s var(--ease);
}

.send:hover {
  background-size: 100% 1px;
}

.form-ok {
  display: none;
  font-family: var(--serif);
  font-size: 1.25rem;
  font-style: italic;
}

.form.is-sent .fields {
  display: none;
}

.form.is-sent .form-ok {
  display: block;
}

/* —— Footer —— */
.footer {
  padding: 1.5rem var(--space) calc(1.75rem + var(--safe-b));
  border-top: 1px solid var(--hairline);
  color: var(--mute);
  font-size: 0.75rem;
}

.footer-inner {
  width: var(--page);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
}

.footer a {
  min-height: 2.5rem;
  display: inline-flex;
  align-items: center;
  transition: color 0.35s var(--ease);
}

.footer a:hover {
  color: inherit;
}

.footer-brand {
  color: inherit;
  font-family: var(--serif);
  font-size: 0.95rem;
}

/* —— Révélations —— */
.reveal {
  opacity: 0;
  transform: translateY(14px);
}

.reveal.is-in {
  opacity: 1;
  transform: none;
  transition: opacity 1.1s var(--ease), transform 1.1s var(--ease);
}

/* —— Légal —— */
.legal {
  width: min(100%, 40rem);
  margin: 0 auto;
  padding: calc(var(--nav-h) + 3rem) var(--space) var(--breath);
}

.legal h1 {
  font-family: var(--serif);
  font-size: 2.2rem;
  font-weight: 400;
  margin: 0 0 1.5rem;
}

.legal h2 {
  font-family: var(--serif);
  font-size: 1.4rem;
  font-weight: 400;
  margin: 2rem 0 0.6rem;
}

.legal p {
  color: var(--mute);
  margin: 0 0 1em;
}

/* —— Réduction du mouvement —— */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .entry-media img,
  .entry-name,
  .entry-universe,
  .entry-invite,
  .reveal,
  .reveal.is-in,
  .sommaire-plate img {
    animation: none !important;
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}

/* —— Responsive —— */
@media (max-width: 1100px) {
  .menu-list {
    display: none;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .nav.is-open .menu {
    display: block;
  }

  .menu {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 51;
    background: var(--ivory);
    color: var(--ink);
    padding: calc(5.5rem + var(--safe-t)) var(--space) calc(2rem + var(--safe-b));
    overflow: auto;
  }

  .page-night .menu {
    background: var(--night);
    color: var(--ivory);
  }

  .nav.is-open .menu-list {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    min-height: 70dvh;
    gap: 0.35rem;
  }

  .menu-list a {
    font-family: var(--serif);
    font-size: clamp(1.8rem, 7vw, 2.6rem);
    letter-spacing: 0;
    text-transform: none;
    opacity: 1;
    padding: 0.2rem 0;
  }
}

@media (max-width: 900px) {
  .sommaire,
  .object {
    grid-template-columns: 1fr;
  }

  .sommaire-plate {
    min-height: 52vw;
    order: -1;
  }

  .plate--left,
  .plate--right,
  .plate--narrow,
  .plate--small,
  .plate--page,
  .plate--wide {
    width: min(92vw, 920px);
    margin-inline: auto;
  }

  .entry-hint {
    writing-mode: horizontal-tb;
    right: auto;
    left: 50%;
    translate: -50% 0;
  }
}

@media (max-width: 640px) {
  .plate--bleed img {
    max-height: 78dvh;
  }

  .meta li {
    grid-template-columns: 1fr;
    gap: 0.2rem;
  }

  .work-nav {
    flex-direction: column;
    text-align: left;
  }

  .work-nav .next {
    margin-left: 0;
    text-align: left;
  }
}

@media (max-height: 500px) and (orientation: landscape) {
  .entry {
    min-height: auto;
    padding-top: 5rem;
  }

  .entry-hint {
    display: none;
  }
}
