/* ============================================================
   AUDE — 18  ·  styles
   Esthétique : livre-mémoire éditorial, papier crème + encre,
   accent terracotta. Mobile-first.
   ============================================================ */

:root {
  /* Palette */
  --paper: #f2ede4;
  --paper-shade: #ebe3d3;
  --ink: #1a1814;
  --ink-soft: #3a342c;
  --sepia: #7a6a55;
  --rust: #a8451f;
  --gold: #c9a35f;
  --rule: rgba(26, 24, 20, 0.18);

  /* Typo */
  --serif: "Fraunces", "EB Garamond", Georgia, serif;
  --script: "Caveat", "Bradley Hand", cursive;

  /* Espaces */
  --pad: clamp(1.25rem, 5vw, 3rem);
  --pad-y: clamp(3rem, 10vw, 6rem);
  --maxw: 1180px;

  /* Motion */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

* {
  box-sizing: border-box;
}

/* L'attribut hidden doit toujours masquer, peu importe le display: ... d'auteur */
[hidden] { display: none !important; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-variation-settings: "opsz" 14;
  font-weight: 400;
  font-size: 18px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;

  /* Grain papier discret */
  background-image:
    radial-gradient(rgba(26, 24, 20, 0.02) 1px, transparent 1px),
    radial-gradient(rgba(26, 24, 20, 0.02) 1px, transparent 1px);
  background-size: 3px 3px, 7px 7px;
  background-position: 0 0, 2px 2px;
}

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

a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
  transition: color 0.3s var(--ease), border-color 0.3s var(--ease);
}
a:hover,
a:focus-visible {
  color: var(--rust);
  border-bottom-color: currentColor;
}

img,
video {
  display: block;
  max-width: 100%;
  height: auto;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 2px solid var(--rust);
  outline-offset: 3px;
}

/* ============================================================
   Atomes typographiques
   ============================================================ */

.eyebrow {
  font-family: var(--serif);
  font-variation-settings: "opsz" 10;
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--sepia);
  font-weight: 500;
}

.section-title {
  font-family: var(--serif);
  font-variation-settings: "opsz" 144;
  font-style: italic;
  font-weight: 500;
  font-size: clamp(2.6rem, 9vw, 5.5rem);
  line-height: 0.95;
  margin: 0 0 0.4em;
  color: var(--ink);
}

.folio {
  font-family: var(--serif);
  font-variation-settings: "opsz" 10;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.4em;
  color: var(--sepia);
  margin: 0 0 1.2em;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
}

.dropcap {
  float: left;
  font-family: var(--serif);
  font-variation-settings: "opsz" 144;
  font-weight: 600;
  font-size: 4.2em;
  line-height: 0.82;
  padding: 0.05em 0.12em 0 0;
  color: var(--rust);
  font-style: italic;
}

.lead {
  font-family: var(--serif);
  font-variation-settings: "opsz" 24;
  font-size: 1.18rem;
  line-height: 1.6;
}

.signature {
  margin-top: 2em;
  font-family: var(--script);
  font-size: 1.7rem;
  color: var(--ink-soft);
  line-height: 1.1;
}

em {
  font-style: italic;
  font-variation-settings: "opsz" 144;
}

/* ============================================================
   COVER
   ============================================================ */

.cover {
  position: relative;
  min-height: 100svh;
  padding: calc(env(safe-area-inset-top, 0) + 2rem) var(--pad) 3rem;
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  gap: 2rem;
  overflow: hidden;
  isolation: isolate;
}

.cover__paper {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse at 30% 0%, rgba(168, 69, 31, 0.08), transparent 55%),
    radial-gradient(ellipse at 80% 100%, rgba(201, 163, 95, 0.12), transparent 50%),
    var(--paper);
}

.cover__meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--rule);
}

.cover__title {
  position: relative;
  align-self: center;
  text-align: center;
  padding: 1rem 0;
}

.cover__big {
  position: absolute;
  inset: 50% 0 auto 50%;
  transform: translate(-50%, -52%);
  font-family: var(--serif);
  font-variation-settings: "opsz" 144;
  font-weight: 300;
  font-style: italic;
  font-size: clamp(16rem, 65vw, 32rem);
  line-height: 0.78;
  color: var(--ink);
  opacity: 0.07;
  letter-spacing: -0.04em;
  pointer-events: none;
  user-select: none;
  z-index: 0;
  white-space: nowrap;
  animation: ghostFade 1.6s var(--ease) 0.2s both;
}

.cover__name {
  position: relative;
  z-index: 1;
  margin: 0;
  font-family: var(--serif);
  font-variation-settings: "opsz" 144;
  font-weight: 400;
  font-style: italic;
  font-size: clamp(4.5rem, 22vw, 11rem);
  line-height: 0.85;
  letter-spacing: 0.02em;
  color: var(--ink);
  display: flex;
  justify-content: center;
  gap: 0.04em;
}
.cover__name span {
  display: inline-block;
  animation: letterIn 1.1s var(--ease) both;
}
.cover__name span:nth-child(1) { animation-delay: 0.35s; }
.cover__name span:nth-child(2) { animation-delay: 0.45s; }
.cover__name span:nth-child(3) { animation-delay: 0.55s; }
.cover__name span:nth-child(4) { animation-delay: 0.65s; }

.cover__sub {
  position: relative;
  z-index: 1;
  margin: 1.4rem 0 0;
  font-family: var(--serif);
  font-variation-settings: "opsz" 24;
  font-size: clamp(1.05rem, 4vw, 1.45rem);
  line-height: 1.45;
  color: var(--ink-soft);
  animation: fadeIn 1.3s var(--ease) 1s both;
}

.cover__nav {
  display: flex;
  gap: 1.8rem;
  justify-content: center;
  flex-wrap: wrap;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
  animation: fadeIn 1.3s var(--ease) 1.3s both;
}
.cover__nav a {
  font-variation-settings: "opsz" 10;
  font-size: 0.78rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  border-bottom: none;
  color: var(--ink-soft);
}
.cover__nav a:hover,
.cover__nav a:focus-visible {
  color: var(--rust);
}

.cover__scroll {
  position: absolute;
  bottom: 1.2rem;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--script);
  font-size: 1.05rem;
  color: var(--sepia);
  animation: bobFade 2.4s var(--ease) infinite;
}

/* ============================================================
   ÉDITO
   ============================================================ */

.edito {
  padding: var(--pad-y) var(--pad);
  background:
    linear-gradient(to bottom, transparent, rgba(26, 24, 20, 0.03)),
    var(--paper);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

.edito__inner {
  max-width: 38rem;
  margin: 0 auto;
}

.edito p {
  margin: 0 0 1.1em;
}

.edito p::first-letter {
  /* respecte le dropcap géré séparément */
}

/* ============================================================
   GALERIE
   ============================================================ */

.galerie {
  padding: var(--pad-y) 0 var(--pad-y);
}

.galerie__head {
  padding: 0 var(--pad);
  max-width: var(--maxw);
  margin: 0 auto 3rem;
  text-align: center;
}

.galerie__sub {
  font-family: var(--serif);
  font-variation-settings: "opsz" 14;
  font-style: italic;
  color: var(--sepia);
  margin: 0;
  font-size: 1rem;
}

.galerie__live {
  display: inline-block;
  margin-top: 1.4rem;
  font-family: var(--serif);
  font-variation-settings: "opsz" 10;
  font-size: 0.78rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--paper);
  background: var(--ink);
  padding: 0.95rem 1.6rem;
  border: none;
  cursor: pointer;
  transition: background 0.3s var(--ease), transform 0.15s var(--ease);
}
.galerie__live:hover,
.galerie__live:focus-visible {
  color: var(--paper);
  background: var(--rust);
  border-bottom: none;
}
.galerie__live:active { transform: translateY(1px); }

.galerie__grid {
  --gap: 6px;
  padding: 0 var(--gap);
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-auto-flow: dense;
  gap: var(--gap);
}

@media (min-width: 600px) {
  .galerie__grid {
    --gap: 10px;
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 960px) {
  .galerie__grid {
    --gap: 12px;
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (min-width: 1400px) {
  .galerie__grid {
    grid-template-columns: repeat(5, 1fr);
  }
}

.tile {
  position: relative;
  overflow: hidden;
  background: var(--paper-shade);
  cursor: zoom-in;
  aspect-ratio: 1;
  list-style: none;
  border: none;
  padding: 0;
  display: block;
  width: 100%;
}

.tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease), filter 0.4s var(--ease);
  filter: saturate(0.92) contrast(1.02);
}

.tile:hover img,
.tile:focus-visible img {
  transform: scale(1.04);
  filter: saturate(1) contrast(1.05);
}

/* Variations éditoriales : certaines tuiles s'étendent */
.tile--wide { grid-column: span 2; aspect-ratio: 2 / 1; }
.tile--tall { grid-row: span 2; aspect-ratio: 1 / 2; }
.tile--big  { grid-column: span 2; grid-row: span 2; aspect-ratio: 1; }

@media (max-width: 599px) {
  /* Sur mobile, garder simple : pas de "big" qui prend tout l'écran */
  .tile--big { grid-column: span 2; grid-row: span 1; aspect-ratio: 1; }
  .tile--tall { grid-row: span 1; aspect-ratio: 1; }
}

.tile__badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(26, 24, 20, 0.65);
  color: var(--paper);
  font-family: var(--serif);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  padding: 3px 8px;
  text-transform: uppercase;
  backdrop-filter: blur(2px);
}

.tile__play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
  color: var(--paper);
  font-size: 2.5rem;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
  opacity: 0.9;
}

.galerie__end {
  text-align: center;
  font-family: var(--script);
  color: var(--sepia);
  font-size: 1.3rem;
  margin: 3rem 0 0;
}

/* Apparition au scroll */
.tile {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.tile.is-in {
  opacity: 1;
  transform: none;
}

/* ============================================================
   LETTRES (GUESTBOOK)
   ============================================================ */

.lettres {
  padding: var(--pad-y) var(--pad);
  background:
    linear-gradient(to bottom, rgba(26, 24, 20, 0.04), transparent 30%),
    var(--paper);
  border-top: 1px solid var(--rule);
}

.lettres__head {
  max-width: 38rem;
  margin: 0 auto 2.5rem;
  text-align: center;
}

.lettres__sub {
  font-family: var(--serif);
  font-style: italic;
  color: var(--sepia);
  margin: 0;
}

.lettre-form {
  max-width: 38rem;
  margin: 0 auto 4rem;
  display: grid;
  gap: 1.4rem;
  padding: 2rem 1.8rem;
  background: #fbf6ec;
  border: 1px solid var(--rule);
  box-shadow:
    0 1px 0 var(--paper-shade),
    0 18px 35px -28px rgba(26, 24, 20, 0.4);
  position: relative;
}

.lettre-form::before {
  /* Pli en haut à droite, façon enveloppe */
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 36px;
  height: 36px;
  background:
    linear-gradient(225deg, var(--paper) 50%, transparent 50%);
  box-shadow: -1px 1px 0 var(--rule);
}

.field {
  display: grid;
  gap: 0.4rem;
  position: relative;
}

.field label {
  font-family: var(--serif);
  font-variation-settings: "opsz" 10;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--sepia);
}

.field input,
.field textarea {
  font-family: var(--script);
  font-size: 1.5rem;
  line-height: 1.45;
  color: var(--ink);
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--rule);
  padding: 0.4rem 0.1rem;
  resize: vertical;
  transition: border-color 0.3s var(--ease);
}

.field textarea {
  min-height: 6rem;
}

.field input::placeholder,
.field textarea::placeholder {
  color: var(--sepia);
  opacity: 0.55;
}

.field input:focus,
.field textarea:focus {
  border-bottom-color: var(--rust);
  outline: none;
}

.counter {
  font-family: var(--serif);
  font-size: 0.7rem;
  color: var(--sepia);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.btn-send {
  justify-self: end;
  font-family: var(--serif);
  font-variation-settings: "opsz" 10;
  font-size: 0.78rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--paper);
  background: var(--ink);
  padding: 0.95rem 1.7rem;
  transition: background 0.3s var(--ease), transform 0.2s var(--ease);
  cursor: pointer;
}

.btn-send:hover:not(:disabled),
.btn-send:focus-visible:not(:disabled) {
  background: var(--rust);
}
.btn-send:active:not(:disabled) {
  transform: translateY(1px);
}
.btn-send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.lettre-status {
  margin: 0;
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.95rem;
  color: var(--sepia);
  min-height: 1.4em;
}
.lettre-status.is-error { color: var(--rust); }
.lettre-status.is-success {
  color: var(--ink);
  font-family: var(--script);
  font-size: 1.4rem;
  font-style: normal;
}

.lettres__list {
  max-width: 60rem;
  margin: 0 auto;
  display: grid;
  gap: 1.6rem;
}

@media (min-width: 720px) {
  .lettres__list {
    grid-template-columns: 1fr 1fr;
    gap: 1.6rem;
  }
}

.lettre {
  background: #fbf6ec;
  padding: 1.6rem 1.6rem 1.4rem;
  border: 1px solid var(--rule);
  position: relative;
  box-shadow:
    0 1px 0 var(--paper-shade),
    0 14px 28px -24px rgba(26, 24, 20, 0.35);
  /* Légère inclinaison aléatoire (cf. JS) */
  transform: rotate(var(--tilt, 0deg));
  transition: transform 0.3s var(--ease);
}

.lettre--shout {
  background: #1a1814;
  color: var(--paper);
  border-color: var(--ink);
}
.lettre--shout .lettre__body { color: var(--paper); font-size: 1.6rem; }
.lettre--shout .lettre__sign { color: var(--gold); }
.lettre--shout .lettre__date { color: rgba(242, 237, 228, 0.55); }
.lettre--shout .lettre__foot { border-top-color: rgba(242, 237, 228, 0.22); }

.lettre__tag {
  display: inline-block;
  font-variation-settings: "opsz" 10;
  font-size: 0.65rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--gold);
  border: 1px solid currentColor;
  padding: 2px 8px;
  margin-bottom: 0.8rem;
}

.lettre:hover {
  transform: rotate(0) translateY(-2px);
  z-index: 2;
}

.lettre__body {
  font-family: var(--script);
  font-size: 1.45rem;
  line-height: 1.35;
  color: var(--ink-soft);
  margin: 0 0 1rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.lettre__foot {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-top: 1px solid var(--rule);
  padding-top: 0.8rem;
  gap: 1rem;
}

.lettre__sign {
  font-family: var(--script);
  font-size: 1.6rem;
  color: var(--rust);
  line-height: 1;
}
.lettre__sign::before {
  content: "— ";
  color: var(--sepia);
}

.lettre__date {
  font-family: var(--serif);
  font-variation-settings: "opsz" 10;
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--sepia);
  font-variant-numeric: tabular-nums;
}

.loading {
  text-align: center;
  font-family: var(--script);
  color: var(--sepia);
  font-size: 1.2rem;
  grid-column: 1 / -1;
}

/* ============================================================
   PETITS MOTS DU JOUR J — archive des messages "à l'écran"
   ============================================================ */

.petits-mots {
  padding: var(--pad-y) var(--pad);
  background:
    linear-gradient(to bottom, rgba(26, 24, 20, 0.04), rgba(26, 24, 20, 0.06)),
    var(--paper);
  border-top: 1px solid var(--rule);
}

.petits-mots__head {
  max-width: 38rem;
  margin: 0 auto 2.5rem;
  text-align: center;
}

.petits-mots__sub {
  font-family: var(--serif);
  font-style: italic;
  color: var(--sepia);
  margin: 0;
}

.petits-mots__list {
  max-width: var(--maxw);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

@media (min-width: 720px) {
  .petits-mots__list {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.2rem;
  }
}
@media (min-width: 1100px) {
  .petits-mots__list {
    grid-template-columns: repeat(4, 1fr);
  }
}

.petit-mot {
  background: var(--ink);
  color: var(--paper);
  padding: 1.2rem 1.2rem 1rem;
  position: relative;
  border-left: 3px solid var(--rust);
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  min-height: 9rem;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.petit-mot:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 30px -18px rgba(26, 24, 20, 0.55);
}

.petit-mot__body {
  font-family: var(--script);
  font-size: 1.4rem;
  line-height: 1.25;
  color: var(--paper);
  margin: 0;
  flex: 1;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.petit-mot__foot {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-top: 1px solid rgba(242, 237, 228, 0.18);
  padding-top: 0.6rem;
  gap: 0.8rem;
}

.petit-mot__sign {
  font-family: var(--script);
  font-size: 1.25rem;
  color: var(--gold);
  line-height: 1;
}
.petit-mot__sign::before { content: "— "; color: var(--sepia); }

.petit-mot__date {
  font-variation-settings: "opsz" 10;
  font-size: 0.65rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(242, 237, 228, 0.55);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.petits-mots__list .loading {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--sepia);
  font-family: var(--script);
  font-size: 1.2rem;
}

/* ============================================================
   COLOPHON
   ============================================================ */

.colophon {
  padding: var(--pad-y) var(--pad) calc(env(safe-area-inset-bottom, 0) + 3rem);
  text-align: center;
  border-top: 1px solid var(--rule);
}

.colophon__inner {
  max-width: 38rem;
  margin: 0 auto;
}

.colophon p {
  margin: 0.4em 0;
  font-size: 0.95rem;
  color: var(--ink-soft);
}

.colophon__credit a {
  border-bottom: none;
  font-family: var(--serif);
  font-variation-settings: "opsz" 10;
  font-size: 0.78rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  margin-left: 0.4em;
}

/* ============================================================
   LIGHTBOX
   ============================================================ */

.lightbox {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: none;
  background: rgba(26, 24, 20, 0.96);
  color: var(--paper);
  z-index: 100;
}

.lightbox::backdrop {
  background: rgba(26, 24, 20, 0.95);
}

.lightbox[open] {
  display: grid;
  grid-template-rows: 1fr auto;
  animation: fadeIn 0.3s var(--ease);
}

.lightbox__stage {
  display: grid;
  place-items: center;
  padding: clamp(3rem, 6vh, 4rem) clamp(0.5rem, 3vw, 2rem) 0.5rem;
  overflow: hidden;
}

.lightbox__stage img,
.lightbox__stage video {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  box-shadow: 0 25px 60px -30px rgba(0, 0, 0, 0.9);
  background: var(--ink);
}

.lightbox__caption {
  text-align: center;
  font-family: var(--serif);
  font-variation-settings: "opsz" 10;
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(242, 237, 228, 0.7);
  padding: 1rem 1rem calc(env(safe-area-inset-bottom, 0) + 1.4rem);
  font-variant-numeric: tabular-nums;
}

.lightbox__close,
.lightbox__nav {
  position: absolute;
  z-index: 2;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  color: var(--paper);
  font-size: 1.6rem;
  background: rgba(242, 237, 228, 0.08);
  border-radius: 50%;
  transition: background 0.3s var(--ease);
}

.lightbox__close:hover,
.lightbox__nav:hover,
.lightbox__close:focus-visible,
.lightbox__nav:focus-visible {
  background: rgba(242, 237, 228, 0.18);
}

.lightbox__close {
  top: calc(env(safe-area-inset-top, 0) + 1rem);
  right: 1rem;
  font-size: 1.2rem;
}

.lightbox__nav {
  top: 50%;
  transform: translateY(-50%);
  font-size: 2rem;
}
.lightbox__nav--prev { left: 0.5rem; }
.lightbox__nav--next { right: 0.5rem; }

@media (min-width: 900px) {
  .lightbox__close { top: 1.5rem; right: 1.5rem; width: 56px; height: 56px; }
  .lightbox__nav { width: 56px; height: 56px; }
  .lightbox__nav--prev { left: 1.5rem; }
  .lightbox__nav--next { right: 1.5rem; }
}

/* ============================================================
   COQUE MOBILE — l'expérience par défaut sur téléphone.
   ============================================================ */

/* Sur mobile : on cache tout le site éditorial et on affiche la coque */
@media (pointer: coarse), (max-width: 819px) {
  html, body { overflow: hidden; height: 100dvh; }
  .splash,
  .cover,
  .edito,
  .galerie,
  .lettres,
  .petits-mots,
  .colophon,
  .lightbox { display: none !important; }
  .mshell[hidden] { display: block !important; }
}

/* Sur desktop : la coque est cachée */
@media (pointer: fine) and (min-width: 820px) {
  .mshell { display: none !important; }
}

.mshell {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  /* 100dvh : zone visible dynamique (s'adapte aux barres iOS qui s'affichent / se cachent).
     Fallback 100vh pour les navigateurs sans dvh. */
  height: 100vh;
  height: 100dvh;
  background: var(--paper);
  color: var(--ink);
  overflow: hidden;
  z-index: 50;
}

/* Empêche le double-tap-zoom et le surlignement gris sur tous les contrôles
   de la coque mobile (les invités spamment vite, le browser zoom sinon). */
.mshell button,
.mshell a {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.mview {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  padding: calc(env(safe-area-inset-top, 0) + 1.2rem)
           clamp(1rem, 5vw, 1.6rem)
           calc(env(safe-area-inset-bottom, 0) + 1.2rem);
  background: var(--paper);
}
.mview.is-active { display: flex; animation: viewIn 0.35s var(--ease); }

@keyframes viewIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

/* --- HOME ---------------------------------------------------- */

.mview--home {
  background:
    radial-gradient(ellipse at 30% 0%, rgba(168, 69, 31, 0.07), transparent 60%),
    radial-gradient(ellipse at 80% 100%, rgba(201, 163, 95, 0.10), transparent 55%),
    var(--paper);
  justify-content: space-between;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.mhero { text-align: center; padding-top: 0.4rem; }
.mhero__eyebrow {
  font-variation-settings: "opsz" 10;
  font-size: 0.7rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--sepia);
  margin: 0 0 0.4rem;
}
.mhero__name {
  font-family: var(--serif);
  font-variation-settings: "opsz" 144;
  font-style: italic;
  font-weight: 400;
  font-size: clamp(3.4rem, 18vw, 5.4rem);
  line-height: 0.9;
  margin: 0;
  color: var(--ink);
}
.mhero__sub {
  font-family: var(--serif);
  font-variation-settings: "opsz" 24;
  font-style: italic;
  font-size: clamp(0.98rem, 4.3vw, 1.25rem);
  color: var(--ink-soft);
  margin: 0.3em 0 0;
  line-height: 1.25;
}

.mchoices {
  display: grid;
  gap: 0.55rem;
  margin: 1rem 0;
}

.mchoice {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 0.8rem;
  text-align: left;
  padding: 0.85rem 1rem;
  border: 1px solid var(--rule);
  background: rgba(251, 246, 236, 0.6);
  cursor: pointer;
  min-height: 60px;
  transition: background 0.2s var(--ease), transform 0.15s var(--ease), border-color 0.2s var(--ease);
}
.mchoice:active {
  transform: scale(0.98);
  background: rgba(168, 69, 31, 0.08);
  border-color: var(--rust);
}
.mchoice__icon {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.45rem;
  color: var(--rust);
  width: 1.4em;
  text-align: center;
}
.mchoice__body { display: grid; gap: 0.15rem; }
.mchoice__title {
  font-family: var(--serif);
  font-variation-settings: "opsz" 24;
  font-style: italic;
  font-size: 1.1rem;
  color: var(--ink);
  line-height: 1.15;
}
.mchoice__desc {
  font-family: var(--serif);
  font-size: 0.82rem;
  color: var(--ink-soft);
  line-height: 1.25;
}

.mhome__foot {
  text-align: center;
  font-family: var(--script);
  font-size: 1.1rem;
  color: var(--sepia);
  margin: 0;
  line-height: 1.2;
}

/* --- topbar (formulaires) ------------------------------------ */

.mtopbar {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--rule);
}
.mback {
  font-family: var(--serif);
  font-size: 1.6rem;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  margin-left: -0.4rem;
}
.mback:active { background: rgba(26, 24, 20, 0.06); }
.mback--floating {
  position: absolute;
  top: calc(env(safe-area-inset-top, 0) + 0.6rem);
  left: 0.6rem;
  z-index: 3;
  color: var(--paper);
  background: rgba(0, 0, 0, 0.35);
  border-radius: 50%;
  width: 44px;
  height: 44px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.mback--share {
  left: auto;
  right: 0.6rem;
}
.mback--share svg { width: 20px; height: 20px; }
.mback--sound {
  left: auto;
  right: calc(0.6rem + 52px);
  font-size: 1.1rem;
}
.mback--sound.is-on { background: rgba(168, 69, 31, 0.75); }

.mtopbar__title {
  font-family: var(--serif);
  font-variation-settings: "opsz" 24;
  font-style: italic;
  font-size: 1.35rem;
  color: var(--ink);
}

/* --- formulaires --------------------------------------------- */

.mform {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  flex: 1;
  min-height: 0;
  padding-top: 1.2rem;
}

.mform__hint {
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.98rem;
  color: var(--sepia);
  margin: 0;
  line-height: 1.4;
}

.mfield {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.mfield--grow {
  flex: 1;
  min-height: 0;
}
.mfield label {
  font-variation-settings: "opsz" 10;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--sepia);
}
.mfield input,
.mfield textarea {
  font-family: var(--script);
  font-size: 1.45rem;
  line-height: 1.4;
  color: var(--ink);
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--rule);
  padding: 0.5rem 0.1rem;
  appearance: none;
  border-radius: 0;
}
.mfield textarea {
  resize: none;
  flex: 1;
  min-height: 0;
}
.mfield input::placeholder,
.mfield textarea::placeholder {
  color: var(--sepia);
  opacity: 0.55;
}
.mfield input:focus,
.mfield textarea:focus {
  outline: none;
  border-bottom-color: var(--rust);
}

.mcounter {
  font-family: var(--serif);
  font-size: 0.72rem;
  color: var(--sepia);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.mbtn {
  font-family: var(--serif);
  font-variation-settings: "opsz" 10;
  font-size: 0.8rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--paper);
  background: var(--ink);
  padding: 1rem 1.2rem;
  border: none;
  cursor: pointer;
  transition: transform 0.15s var(--ease), background 0.25s var(--ease);
}
.mbtn:active { transform: scale(0.98); }
.mbtn:disabled { opacity: 0.4; }
.mbtn--rust { background: var(--rust); }

.mstatus {
  margin: 0;
  min-height: 1.5em;
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.95rem;
  color: var(--sepia);
}
.mstatus.is-error   { color: var(--rust); }
.mstatus.is-success {
  font-family: var(--script);
  font-style: normal;
  font-size: 1.3rem;
  color: var(--ink);
}

/* --- réactions emoji (mobile) --------------------------- */

.mview--reactions { padding-bottom: 2rem; }

.mreact-anim {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.4rem;
  margin: 0.4rem 0 1.4rem;
  border: 1px solid var(--rule);
  padding: 4px;
  background: rgba(251, 246, 236, 0.5);
}
.mreact-anim__btn {
  font-family: var(--serif);
  font-variation-settings: "opsz" 14;
  font-style: italic;
  font-size: 1rem;
  padding: 0.7rem 0.5rem;
  color: var(--sepia);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}
.mreact-anim__btn.is-active {
  background: var(--ink);
  color: var(--paper);
}

.mreact-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.8rem;
  flex: 1;
  align-content: center;
}

.mreact-btn {
  aspect-ratio: 1;
  font-size: clamp(2.5rem, 12vw, 3.5rem);
  background: rgba(251, 246, 236, 0.6);
  border: 1px solid var(--rule);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: transform 0.15s var(--ease), background 0.2s var(--ease), border-color 0.2s var(--ease);
  /* Pas de double-tap-zoom du browser quand on spamme */
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}
.mreact-btn:active {
  transform: scale(0.85);
  background: rgba(168, 69, 31, 0.1);
  border-color: var(--rust);
}
.mreact-btn.is-pulsing {
  animation: mreactPulse 0.6s var(--ease);
}

@keyframes mreactPulse {
  0%   { transform: scale(1); }
  30%  { transform: scale(1.18); }
  100% { transform: scale(1); }
}

/* Particules locales (feedback immédiat sur le tel) */
.mreact-particle {
  position: fixed;
  z-index: 200;
  font-size: 2.2rem;
  pointer-events: none;
  transform: translate(-50%, -50%);
  animation: mreactFly var(--dur, 1100ms) cubic-bezier(0.16, 1, 0.3, 1) forwards;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.3));
  line-height: 1;
}
@keyframes mreactFly {
  0%   { transform: translate(-50%, -50%) scale(0.4) rotate(0deg); opacity: 0; }
  15%  { transform: translate(-50%, -50%) scale(1.1) rotate(0deg); opacity: 1; }
  100% { transform: translate(calc(-50% + var(--dx, 0px)), calc(-50% + var(--dy, -120px))) scale(0.9) rotate(var(--rot, 0deg)); opacity: 0; }
}

/* --- photobooth (mobile) -------------------------------- */

.mview--photobooth { padding: 0; background: #0d0c0a; color: var(--paper); }

.pbooth { position: absolute; inset: 0; display: flex; flex-direction: column; }

.pbooth__stage {
  position: relative;
  flex: 1;
  min-height: 0;
  background: #000;
  overflow: hidden;
}
.pbooth__video,
.pbooth__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: #000;
}
.pbooth__video {
  /* Vidéo en preview : remplit l'écran façon caméra plein cadre */
  object-fit: cover;
  /* Effet miroir : selfie, on voit ce qu'on fait */
  transform: scaleX(-1);
}
.pbooth__canvas {
  /* Capture : contain pour ne PAS rogner les décors (Polaroïd, stickers) */
  object-fit: contain;
}
.pbooth__hint {
  position: absolute;
  inset: auto 1rem 1rem;
  font-family: var(--script);
  font-size: 1.1rem;
  color: rgba(242, 237, 228, 0.8);
  text-align: center;
  text-shadow: 0 2px 6px rgba(0,0,0,0.6);
  margin: 0;
}
.pbooth__overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.pbooth__bar {
  background: rgba(13, 12, 10, 0.92);
  padding: 0.7rem clamp(0.6rem, 4vw, 1.2rem) calc(env(safe-area-inset-bottom, 0) + 1.2rem);
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.pbooth__styles {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.3rem;
  border: 1px solid rgba(242, 237, 228, 0.2);
  padding: 3px;
}
.pbooth__style {
  font-family: var(--serif);
  font-variation-settings: "opsz" 14;
  font-style: italic;
  font-size: 0.85rem;
  padding: 0.55rem 0.2rem;
  color: rgba(242, 237, 228, 0.65);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}
.pbooth__style.is-active {
  background: var(--paper);
  color: var(--ink);
}

.pbooth__actions {
  display: flex;
  justify-content: center;
  align-items: center;
}
.pbooth__shoot {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: transparent;
  border: 3px solid var(--paper);
  cursor: pointer;
  padding: 4px;
  display: grid;
  place-items: center;
  transition: transform 0.15s var(--ease);
}
.pbooth__shoot:active { transform: scale(0.92); }
.pbooth__shoot span {
  display: block;
  width: 100%; height: 100%;
  border-radius: 50%;
  background: var(--paper);
  transition: background 0.15s var(--ease);
}
.pbooth__shoot:active span { background: var(--rust); }

.pbooth__post {
  /* Pas absolute : on prend de la place pour ne pas couvrir la photo */
  background: rgba(13, 12, 10, 0.95);
  padding: 1rem clamp(1rem, 4vw, 1.4rem) calc(env(safe-area-inset-bottom, 0) + 1rem);
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  border-top: 1px solid rgba(242, 237, 228, 0.18);
}
.pbooth__name {
  font-family: var(--script);
  font-size: 1.5rem;
  color: var(--paper);
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(242, 237, 228, 0.25);
  padding: 0.4rem 0.1rem;
}
.pbooth__name::placeholder { color: rgba(242, 237, 228, 0.45); }
.pbooth__name:focus { outline: none; border-bottom-color: var(--rust); }

.pbooth__post-actions {
  display: grid;
  grid-template-columns: 1fr 1.8fr;
  gap: 0.6rem;
}
.pbooth__retry {
  background: transparent;
  color: var(--paper);
  border: 1px solid rgba(242, 237, 228, 0.35);
}
/* Quand envoyer est masqué et garder visible, garder prend la place principale */
#pbooth-send[hidden] ~ .pbooth__keep,
.pbooth__keep:not([hidden]) {
  display: inline-block;
}

/* --- capsule temporelle (mobile) ----------------------- */

.mview--capsule { padding-bottom: calc(env(safe-area-inset-bottom, 0) + 1rem); }

.caps {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  flex: 1;
  min-height: 0;
  padding-top: 1rem;
}

.caps__intro {
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.98rem;
  color: var(--sepia);
  margin: 0;
  line-height: 1.4;
}
.caps__intro strong {
  font-weight: 600;
  color: var(--ink);
  font-style: normal;
}

.caps__stage {
  position: relative;
  aspect-ratio: 3 / 4;
  background: #000;
  overflow: hidden;
  border-radius: 4px;
}
.caps__video, .caps__preview {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
}
.caps__video { transform: scaleX(-1); }

.caps__timer {
  position: absolute;
  top: 0.7rem;
  right: 0.7rem;
  background: rgba(0, 0, 0, 0.55);
  color: var(--paper);
  font-family: var(--serif);
  font-variation-settings: "opsz" 10;
  font-size: 0.8rem;
  letter-spacing: 0.18em;
  padding: 5px 10px;
  border-radius: 999px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  font-variant-numeric: tabular-nums;
}
.caps__timer.is-recording { background: var(--rust); animation: capsBlink 1s ease-in-out infinite; }
.caps__timer.is-done { background: rgba(26, 24, 20, 0.7); }
@keyframes capsBlink { 50% { opacity: 0.6; } }

.caps__progress {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 4px;
  background: rgba(255, 255, 255, 0.18);
}
.caps__progress > span {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--rust);
  transition: width 100ms linear;
}

.caps__controls {
  display: flex;
  justify-content: center;
}
.caps__rec {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: transparent;
  border: 3px solid var(--ink);
  cursor: pointer;
  padding: 6px;
  display: grid;
  place-items: center;
  transition: transform 0.15s var(--ease);
}
.caps__rec:active { transform: scale(0.92); }
.caps__rec-dot {
  display: block;
  width: 100%; height: 100%;
  border-radius: 50%;
  background: var(--rust);
  transition: border-radius 0.25s var(--ease), background 0.25s var(--ease);
}
.caps__rec.is-recording .caps__rec-dot {
  border-radius: 18%;
  background: var(--ink);
}

.caps__form {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

#caps-date {
  font-family: var(--serif);
  font-size: 1.1rem;
  color: var(--ink);
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--rule);
  padding: 0.5rem 0.1rem;
  appearance: none;
  border-radius: 0;
}
#caps-date:focus { outline: none; border-bottom-color: var(--rust); }

/* --- galerie plein écran (mobile) ---------------------------- */

.mview--gallery {
  padding: 0;
  background: #0d0c0a;
}

.mgallery {
  position: absolute;
  inset: 0;
  overflow: hidden;
  touch-action: pan-y;
}

.mframe {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 700ms var(--ease);
  overflow: hidden;
  background: #0d0c0a;
}
.mframe.is-on { opacity: 1; }

.mframe__blur,
.mframe__fg {
  position: absolute;
  background-repeat: no-repeat;
  background-position: center;
}
.mframe__blur {
  top: -8%; right: -8%; bottom: -8%; left: -8%;
  background-size: cover;
  filter: blur(36px) saturate(0.85) brightness(0.55);
  transform: scale(1.15);
}
.mframe__fg {
  top: 0; right: 0; bottom: 0; left: 0;
  background-size: contain;
}
.mframe__video {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #0d0c0a;
}

.mgallery__pos {
  position: absolute;
  top: calc(env(safe-area-inset-top, 0) + 1.1rem);
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  font-family: var(--serif);
  font-variation-settings: "opsz" 10;
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  color: rgba(242, 237, 228, 0.78);
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
  background: rgba(0, 0, 0, 0.35);
  padding: 6px 12px;
  border-radius: 999px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.mgallery__hint {
  position: absolute;
  bottom: calc(env(safe-area-inset-bottom, 0) + 1.2rem);
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  font-family: var(--script);
  font-size: 1.1rem;
  color: rgba(242, 237, 228, 0.85);
  text-shadow: 0 1px 6px rgba(0,0,0,0.6);
  transition: opacity 0.6s var(--ease);
  pointer-events: none;
}
.mgallery.is-touched .mgallery__hint { opacity: 0; }

/* ============================================================
   SPLASH (modale d'arrivée) — DEPRECATED, plus utilisée
   ============================================================ */

.splash {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: none;
  background: rgba(26, 24, 20, 0.92);
  color: var(--paper);
  z-index: 200;
}
.splash::backdrop { background: rgba(26, 24, 20, 0.85); }
.splash[open] {
  display: grid;
  place-items: center;
  padding: 1.5rem;
  animation: fadeIn 0.4s var(--ease);
}

.splash__paper {
  width: 100%;
  max-width: 32rem;
  background: var(--paper);
  color: var(--ink);
  padding: clamp(1.8rem, 6vw, 2.6rem) clamp(1.6rem, 6vw, 2.4rem);
  text-align: center;
  box-shadow: 0 40px 80px -20px rgba(0,0,0,0.4);
  position: relative;
  animation: splashIn 0.6s var(--ease) both;
}
.splash__paper::before {
  content: "";
  position: absolute;
  top: 0; right: 0;
  width: 30px; height: 30px;
  background: linear-gradient(225deg, #d8cdb6 50%, transparent 50%);
}

.splash__eyebrow {
  font-variation-settings: "opsz" 10;
  font-size: 0.78rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--sepia);
  margin: 0 0 1.2em;
}

.splash__title {
  font-family: var(--serif);
  font-variation-settings: "opsz" 144;
  font-style: italic;
  font-weight: 500;
  font-size: clamp(2rem, 7vw, 2.8rem);
  line-height: 1;
  margin: 0 0 0.6em;
  color: var(--ink);
}

.splash__lead {
  font-family: var(--serif);
  font-style: italic;
  color: var(--sepia);
  margin: 0 0 1.6em;
  font-size: 1.05rem;
}

.splash__choices {
  display: grid;
  gap: 0.8rem;
  margin-bottom: 1.4em;
}

.choice {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  align-items: baseline;
  gap: 0 0.8rem;
  padding: 1.2rem 1.3rem;
  background: transparent;
  border: 1px solid var(--rule);
  text-align: left;
  cursor: pointer;
  transition: background 0.25s var(--ease), border-color 0.25s var(--ease), transform 0.2s var(--ease);
}
.choice:hover,
.choice:focus-visible {
  background: rgba(168, 69, 31, 0.06);
  border-color: var(--rust);
}
.choice:active { transform: translateY(1px); }

.choice__icon {
  grid-row: span 2;
  font-size: 1.6rem;
  color: var(--rust);
  font-family: var(--serif);
}
.choice__title {
  font-family: var(--serif);
  font-variation-settings: "opsz" 24;
  font-style: italic;
  font-size: 1.4rem;
  color: var(--ink);
  line-height: 1;
}
.choice__desc {
  font-family: var(--serif);
  font-size: 0.92rem;
  line-height: 1.4;
  color: var(--ink-soft);
  margin-top: 0.4em;
}

.splash__skip {
  font-family: var(--serif);
  font-style: italic;
  color: var(--sepia);
  font-size: 0.95rem;
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-color: var(--rule);
}
.splash__skip:hover,
.splash__skip:focus-visible {
  color: var(--ink);
  text-decoration-color: currentColor;
}

@keyframes splashIn {
  from { opacity: 0; transform: translateY(20px) scale(0.98); }
  to   { opacity: 1; transform: none; }
}

/* ============================================================
   Tabs livre / écran
   ============================================================ */

.mode-tabs {
  max-width: 38rem;
  margin: 0 auto 1rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--rule);
  background: rgba(242, 237, 228, 0.5);
}

.mode-tab {
  font-family: var(--serif);
  font-variation-settings: "opsz" 14;
  font-style: italic;
  font-size: 1.05rem;
  padding: 0.85rem 0.5rem;
  color: var(--sepia);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: color 0.25s var(--ease), background 0.25s var(--ease);
  position: relative;
}
.mode-tab:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 18%; bottom: 18%;
  right: 0;
  width: 1px;
  background: var(--rule);
}
.mode-tab.is-active {
  background: var(--ink);
  color: var(--paper);
}
.mode-tab.is-active::after { display: none; }

.mode-hint {
  max-width: 38rem;
  margin: 0 auto 1rem;
  font-family: var(--serif);
  font-style: italic;
  color: var(--sepia);
  text-align: center;
  font-size: 0.95rem;
  min-height: 1.4em;
  transition: opacity 0.3s var(--ease);
}

/* ============================================================
   PARTAGE (dialog)
   ============================================================ */

.share {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 1.5rem;
  border: none;
  background: rgba(26, 24, 20, 0.85);
  color: var(--ink);
  z-index: 250;
}
.share::backdrop { background: rgba(26, 24, 20, 0.85); }
.share[open] {
  display: grid;
  place-items: center;
  animation: fadeIn 0.3s var(--ease);
}

.share__paper {
  width: 100%;
  max-width: 30rem;
  background: var(--paper);
  padding: clamp(1.6rem, 5vw, 2.2rem) clamp(1.6rem, 5vw, 2rem);
  text-align: center;
  position: relative;
  box-shadow: 0 40px 80px -20px rgba(0,0,0,0.4);
  animation: splashIn 0.5s var(--ease) both;
}
.share__paper::before {
  content: "";
  position: absolute;
  top: 0; right: 0;
  width: 28px; height: 28px;
  background: linear-gradient(225deg, #d8cdb6 50%, transparent 50%);
}

.share__eyebrow {
  font-variation-settings: "opsz" 10;
  font-size: 0.72rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--sepia);
  margin: 0 0 0.6em;
}
.share__title {
  font-family: var(--serif);
  font-variation-settings: "opsz" 144;
  font-style: italic;
  font-weight: 500;
  font-size: clamp(1.7rem, 5vw, 2.1rem);
  margin: 0 0 0.4em;
  line-height: 1;
}
.share__lead {
  font-family: var(--serif);
  font-style: italic;
  color: var(--sepia);
  margin: 0 0 1.4em;
  font-size: 0.98rem;
}

.share__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  margin-bottom: 1.4em;
}

.share__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  padding: 0.9rem 0.6rem;
  font-family: var(--serif);
  font-variation-settings: "opsz" 10;
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink);
  background: rgba(26, 24, 20, 0.04);
  border: 1px solid var(--rule);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease), color 0.2s var(--ease), transform 0.15s var(--ease);
}
.share__btn:hover,
.share__btn:focus-visible {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}
.share__btn:active { transform: translateY(1px); }
.share__btn.is-copied {
  background: var(--rust);
  color: var(--paper);
  border-color: var(--rust);
}
.share__btn-icon {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.05em;
  letter-spacing: 0;
  text-transform: none;
}

.share__close {
  font-family: var(--serif);
  font-style: italic;
  color: var(--sepia);
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-color: var(--rule);
  font-size: 0.95rem;
}
.share__close:hover { color: var(--ink); text-decoration-color: currentColor; }

/* Bouton share dans la lightbox */
.lightbox__share {
  position: absolute;
  z-index: 2;
  top: calc(env(safe-area-inset-top, 0) + 1rem);
  right: calc(1rem + 56px);
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  color: var(--paper);
  background: rgba(242, 237, 228, 0.08);
  border-radius: 50%;
  transition: background 0.3s var(--ease);
}
.lightbox__share svg { width: 20px; height: 20px; }
.lightbox__share:hover,
.lightbox__share:focus-visible {
  background: rgba(242, 237, 228, 0.18);
}
@media (min-width: 900px) {
  .lightbox__share { top: 1.5rem; right: calc(1.5rem + 64px); width: 56px; height: 56px; }
}

/* Bouton share dans la colophon */
.colophon__share {
  font-family: var(--serif);
  font-variation-settings: "opsz" 10;
  font-size: 0.78rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-soft);
  background: none;
  cursor: pointer;
  padding: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  vertical-align: middle;
}
.colophon__share svg { width: 14px; height: 14px; }
.colophon__share:hover,
.colophon__share:focus-visible {
  color: var(--rust);
}

/* ============================================================
   Animations
   ============================================================ */

@keyframes ghostFade {
  from { opacity: 0; transform: translate(-50%, -45%) scale(1.02); }
  to   { opacity: 0.07; transform: translate(-50%, -52%) scale(1); }
}

@keyframes letterIn {
  from { opacity: 0; transform: translateY(0.4em) rotate(-2deg); }
  to   { opacity: 1; transform: none; }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes bobFade {
  0%, 100% { opacity: 0.5; transform: translateX(-50%) translateY(0); }
  50%      { opacity: 1;   transform: translateX(-50%) translateY(4px); }
}
