/* Livre de mémoire — styles (page publique + administration).
   Mise en page : l'interface suit le thème clair/sombre de l'appareil ; l'affiche et le livre
   restent en « papier » clair, comme un vrai support imprimé. Polices hébergées sur le serveur. */

/* ========================================================================== */
/* Polices (variables, sous-ensemble latin : accents français compris)         */
/* ========================================================================== */

@font-face { font-family: "Cormorant"; src: url("/fonts/cormorant.woff2") format("woff2"); font-weight: 300 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Cormorant"; src: url("/fonts/cormorant-italic.woff2") format("woff2"); font-weight: 300 700; font-style: italic; font-display: swap; }
@font-face { font-family: "Nunito Sans"; src: url("/fonts/nunito-sans.woff2") format("woff2"); font-weight: 200 1000; font-style: normal; font-display: swap; }
@font-face { font-family: "Caveat"; src: url("/fonts/caveat.woff2") format("woff2"); font-weight: 400 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Dancing Script"; src: url("/fonts/dancing-script.woff2") format("woff2"); font-weight: 400 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Patrick Hand"; src: url("/fonts/patrick-hand.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Kalam"; src: url("/fonts/kalam.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Special Elite"; src: url("/fonts/special-elite.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }

/* ========================================================================== */
/* Couleurs et typographies                                                   */
/* ========================================================================== */

:root {
  /* Interface */
  --bg: #e4e8ed;
  --panel: #ffffff;
  --ink: #1f2a3a;
  --muted: #5d6b7e;
  --line: #d3dae3;
  --accent: #3f5f80;
  --accent-ink: #ffffff;
  --danger: #b03a48;
  --ok: #3f7d58;
  /* Papier (identique dans les deux thèmes) */
  --paper: #fbfaf7;
  --paper-ink: #1f2a3a;
  --paper-muted: #5d6b7e;
  --paper-line: #dcdfe3;
  --paper-accent: #3f5f80;
  --candle: #e0a43a;
  --cover: #2c3e52;
  --cover-ink: #f2efe8;
  /* Typographies */
  --f-display: "Cormorant", Georgia, "Times New Roman", serif;
  --f-body: "Nunito Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --f-hand: "Caveat", "Segoe Print", "Bradley Hand", cursive;
  --hand-k: 1;   /* échelle du texte selon l'écriture choisie */
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f141b; --panel: #1b232e; --ink: #e6ebf2; --muted: #9aa8ba;
    --line: #2e3948; --accent: #8fb0d1; --accent-ink: #0f141b; --danger: #e06a78; --ok: #7cc49a;
    color-scheme: dark;
  }
}

/* ========================================================================== */
/* Base                                                                       */
/* ========================================================================== */

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
body.public { display: flex; flex-direction: column; overflow: hidden; }
@supports (height: 100dvh) { body.public { height: 100dvh; } }

/* Accueil : la page défile normalement, la barre d'adresse du téléphone peut se replier */
body.public.on-home { display: block; height: auto; min-height: 100%; overflow: visible; }
body.on-home .main { overflow: visible; }
body.on-home .home { position: static; overflow: visible; }
h1, h2, h3 { text-wrap: balance; }
a { color: var(--accent); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible, .photo-drop:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Boutons ---------- */
.btn {
  font: inherit; font-weight: 700; font-size: 15px; border: 1px solid transparent; border-radius: 999px;
  padding: 9px 18px; background: var(--accent); color: var(--accent-ink); cursor: pointer;
  text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: filter .15s, transform .15s;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .6; cursor: wait; }
.btn.big { padding: 13px 26px; font-size: 16px; }
.btn.ghost { background: transparent; color: var(--accent); border-color: var(--accent); }
.btn.danger { background: var(--danger); color: #fff; }
.ico {
  font: inherit; font-weight: 700; min-width: 38px; height: 38px; padding: 0 12px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--panel); color: var(--ink); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; text-decoration: none;
}
.ico:disabled { opacity: .4; cursor: default; }
.ico.wide { font-weight: 600; font-size: 14px; }
.small { font: inherit; font-size: 14px; background: none; border: 0; color: var(--accent); cursor: pointer; text-decoration: underline; padding: 2px 4px; }
.link { font-weight: 600; text-decoration: none; }
.link:hover { text-decoration: underline; }

/* ========================================================================== */
/* Barre du haut                                                              */
/* ========================================================================== */

.top {
  display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between;
  padding: calc(10px + env(safe-area-inset-top, 0px)) 16px 10px;
  background: var(--panel); border-bottom: 1px solid var(--line); position: relative; z-index: 3;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; min-width: 0; }
.brand b { font-family: var(--f-display); font-size: 24px; font-weight: 600; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.on-home .top { display: none; }
.back { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; color: var(--accent); text-decoration: none; padding: 6px 10px 6px 4px; border-radius: 999px; }
.back svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.back:hover { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.top-title { flex: 1; min-width: 0; text-align: center; font-family: var(--f-display); font-size: 22px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-flame { width: 10px; height: 16px; flex: none; border-radius: 50% / 60% 60% 40% 40%; background: var(--candle); box-shadow: 0 0 10px var(--candle); }
.tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.switch { display: flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.switch a { font-size: 14px; font-weight: 600; color: var(--muted); padding: 8px 14px; text-decoration: none; }
.switch a[aria-current="page"] { background: var(--accent); color: var(--accent-ink); }

/* ========================================================================== */
/* Zone principale et flamme                                                  */
/* ========================================================================== */

.main { flex: 1; position: relative; overflow: hidden; }
.flame {
  width: 18px; height: 28px; border-radius: 50% / 60% 60% 40% 40%;
  background: radial-gradient(circle at 50% 70%, #fff3c4 0 18%, var(--candle) 60%);
  box-shadow: 0 0 26px var(--candle); animation: flicker 2.6s ease-in-out infinite;
}
@keyframes flicker { 50% { transform: scale(.9, 1.06) rotate(-2deg); opacity: .86; } }

/* ========================================================================== */
/* Accueil                                                                    */
/* ========================================================================== */

.home { position: absolute; inset: 0; overflow-y: auto; padding: 0 16px; }

/* Bandeau : bleu nuit, halo de bougie, pleine largeur */
.hero {
  margin: 0 -16px; padding: clamp(48px, 9vh, 96px) 16px clamp(44px, 8vh, 80px);
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px;
  color: var(--cover-ink);
  background:
    radial-gradient(ellipse 60% 55% at 50% 62%, rgba(224, 164, 58, .16), transparent 70%),
    linear-gradient(180deg, #24364a 0%, var(--cover) 100%);
}
.hero-portrait {
  width: clamp(140px, 30vw, 200px); aspect-ratio: 1; border-radius: 50%; overflow: hidden; margin-bottom: 14px;
  border: 4px solid rgba(242, 239, 232, .9); box-shadow: 0 0 0 10px rgba(242, 239, 232, .08), 0 18px 50px rgba(0, 0, 0, .35);
}
.hero-portrait img, .portrait img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; display: block; }
.portrait, .hero-portrait { flex-shrink: 0; }
.eyebrow { margin: 0; font-size: 13px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.hero .eyebrow { color: var(--cover-ink); opacity: .7; }
.hero h1 { font-family: var(--f-display); font-weight: 500; font-size: clamp(46px, 10vw, 92px); line-height: .98; margin: 0; letter-spacing: .005em; }
.hero-dates { margin: 2px 0 0; font-family: var(--f-display); font-style: italic; font-size: clamp(22px, 4vw, 30px); opacity: .8; }
.lead { margin: 4px 0 0; max-width: 52ch; font-size: clamp(16px, 2.2vw, 19px); line-height: 1.6; opacity: .88; white-space: pre-line; text-wrap: pretty; }
.cta { display: flex; flex-direction: column; align-items: center; gap: 14px; margin-top: 26px; }
.hero-btn { background: var(--cover-ink); color: var(--cover); padding: 15px 34px; font-size: 17px; box-shadow: 0 10px 30px rgba(0, 0, 0, .25); }
.hero-scroll { display: inline-flex; flex-direction: column; align-items: center; gap: 2px; color: var(--cover-ink); opacity: .75; font-size: 14px; text-decoration: none; }
.hero-scroll:hover { opacity: 1; }
.hero-scroll svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; animation: nudge 2.4s ease-in-out infinite; }
@keyframes nudge { 50% { transform: translateY(4px); } }
.hero-links { margin: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 12px; font-size: 15px; }
.hero-links a { color: var(--cover-ink); font-weight: 600; text-underline-offset: 4px; text-decoration-color: rgba(242, 239, 232, .4); }
.hero-links a:hover { text-decoration-color: currentColor; }
.hero-links span { opacity: .5; }
.install {
  margin-top: 18px; max-width: 360px; width: 100%; padding: 14px 16px; border-radius: 12px;
  background: rgba(242, 239, 232, .08); border: 1px solid rgba(242, 239, 232, .18);
  display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: 14px;
}
.install p { margin: 0; opacity: .85; }
.install .btn { background: transparent; color: var(--cover-ink); border-color: rgba(242, 239, 232, .6); }
.install .small { color: var(--cover-ink); opacity: .7; }
.hero-support {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 16px; padding: 8px 16px; border-radius: 999px;
  color: var(--cover-ink); text-decoration: none; font-weight: 700; font-size: 15px;
  border: 1px solid color-mix(in srgb, var(--cover-ink) 35%, transparent); background: color-mix(in srgb, var(--cover-ink) 8%, transparent);
}
.hero-support:hover { background: color-mix(in srgb, var(--cover-ink) 16%, transparent); }
.hero-support svg { width: 18px; height: 18px; fill: none; stroke: var(--candle); stroke-width: 2; stroke-linejoin: round; }
/* Bougie de l'accueil, sous les dates : cire, flamme vive qui vacille, halo qui respire.
   Toutes les mesures suivent --c (taille d'un « point » de la bougie) : une seule valeur à changer pour l'agrandir. */
.hero-candle { --c: 2.2px; margin: 18px 0 4px; }
.candle { position: relative; display: block; width: calc(18 * var(--c)); height: calc(42 * var(--c)); }
.candle-wax {
  position: absolute; left: calc(3 * var(--c)); bottom: 0; width: calc(12 * var(--c)); height: calc(18 * var(--c));
  border-radius: calc(2 * var(--c)) calc(2 * var(--c)) calc(3 * var(--c)) calc(3 * var(--c));
  background: linear-gradient(90deg, #e3d8bf, #fffaf0 45%, #d2c5a8);
  box-shadow: inset 0 calc(2 * var(--c)) calc(3 * var(--c)) rgba(255, 210, 120, .35);
}
.candle-wax::before {   /* mèche */
  content: ""; position: absolute; left: calc(5 * var(--c)); top: calc(-4 * var(--c));
  width: calc(2 * var(--c)); height: calc(5 * var(--c)); border-radius: var(--c); background: #4a3a2a;
}
.candle-flame {
  position: absolute; left: calc(3 * var(--c)); top: 0; width: calc(12 * var(--c)); height: calc(22 * var(--c));
  border-radius: 50% 50% 45% 45% / 62% 62% 38% 38%;
  background: radial-gradient(ellipse at 50% 72%, #ffffff 0 14%, #fff3c4 24%, #ffd27a 48%, #f0a030 78%, rgba(240, 160, 48, 0) 100%);
  box-shadow: 0 0 calc(10 * var(--c)) calc(3 * var(--c)) rgba(255, 200, 90, .85), 0 0 calc(28 * var(--c)) calc(8 * var(--c)) rgba(255, 170, 60, .45);
  transform-origin: 50% 90%; animation: candleFlicker 2.2s ease-in-out infinite;
}
.candle-glow {
  position: absolute; left: 50%; top: calc(11 * var(--c)); width: calc(70 * var(--c)); height: calc(70 * var(--c));
  transform: translate(-50%, -50%); border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(255, 200, 100, .45), rgba(255, 170, 60, .14) 45%, transparent 70%);
  animation: candleBreath 3.2s ease-in-out infinite;
}
@keyframes candleFlicker {
  0%, 100% { transform: scale(1, 1) rotate(-1deg); }
  25% { transform: scale(.94, 1.06) rotate(1.5deg); }
  50% { transform: scale(1.04, .95) rotate(-2deg); }
  75% { transform: scale(.97, 1.04) rotate(1deg); }
}
@keyframes candleBreath { 50% { opacity: .65; transform: translate(-50%, -50%) scale(.85); } }
/* Phrase sous la bougie */
.candle-caption { margin: 2px 0 6px; font-size: 15px; font-weight: 600; color: #ffd98a; text-shadow: 0 0 12px rgba(255, 190, 90, .45); }
.candle-caption.just-lit { animation: captionIn 1.4s ease-out; }
@keyframes captionIn { from { opacity: 0; transform: translateY(4px); } }
@media (prefers-reduced-motion: reduce) { .candle-flame, .candle-glow { animation: none; } }
/* Phrase du jour (anniversaire) */
.hero-day {
  margin: 0 0 12px; padding: 6px 16px; border-radius: 999px; font-family: var(--f-display); font-style: italic; font-size: 19px;
  color: var(--cover-ink); background: color-mix(in srgb, var(--candle) 14%, transparent); border: 1px solid color-mix(in srgb, var(--candle) 40%, transparent);
}
/* Mot de la famille */
.announce { max-width: 760px; margin: 0 auto; padding: 36px 0 0; }
.announce-card {
  position: relative; padding: 22px 26px; border-radius: 6px; color: var(--paper-ink); background: var(--paper);
  border: 1px solid var(--paper-line); box-shadow: 0 1px 2px rgba(20, 30, 45, .06), 0 8px 22px rgba(20, 30, 45, .07);
}
.announce-card::before {   /* bande de scotch */
  content: ""; position: absolute; top: -10px; left: 50%; width: 96px; height: 22px; transform: translateX(-50%) rotate(-2deg);
  background: rgba(236, 226, 196, .8); box-shadow: 0 1px 2px rgba(0, 0, 0, .08);
}
.announce-label { margin: 0; font-size: 12px; letter-spacing: .2em; text-transform: uppercase; color: var(--paper-muted); font-weight: 700; text-align: center; }
.announce-text { margin: 8px 0 0; font-family: var(--f-display); font-size: 22px; line-height: 1.45; white-space: pre-line; text-align: center; overflow-wrap: anywhere; }
.hero .count { margin: 10px 0 0; font-size: 14px; opacity: .7; font-variant-numeric: tabular-nums; }

/* Cagnotte */
.support { max-width: 1120px; margin: 0 auto; padding: 40px 0 0; }
.support-card {
  display: grid; grid-template-columns: auto 1fr auto; gap: 18px; align-items: center; padding: 22px 24px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--candle) 16%, var(--panel)), var(--panel)); border: 1px solid color-mix(in srgb, var(--candle) 45%, var(--line)); border-radius: 16px;
}
.support-icon { width: 46px; height: 46px; padding: 10px; border-radius: 50%; fill: none; stroke: #b5751c; stroke-width: 1.8; stroke-linejoin: round; background: color-mix(in srgb, var(--candle) 22%, var(--panel)); }
.support-text h2 { font-size: 28px; }
.support-text p { margin: 2px 0 0; color: var(--muted); }
.support-btn { background: #b5751c; color: #fff; }
@media (max-width: 720px) {
  .support-card { grid-template-columns: auto 1fr; }
  .support-btn { grid-column: 1 / -1; width: 100%; }
}

/* Souvenirs : mosaïque de l'album */
.album-section { max-width: 1120px; margin: 0 auto; padding: 52px 0 0; }
.album-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.album-strip .gal-item { border-width: 6px; transition: transform .2s; }
.album-strip .gal-item:nth-child(3n + 1) { transform: rotate(-1.2deg); }
.album-strip .gal-item:nth-child(3n + 2) { transform: rotate(.9deg); }
.album-strip .gal-item:hover { transform: rotate(0) scale(1.03); z-index: 1; }
@media (max-width: 720px) {
  .album-strip { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; padding: 6px 2px 14px; margin: 0 -16px; padding-left: 16px; }
  .album-strip .gal-item { flex: 0 0 62%; scroll-snap-align: center; }
}

/* Écritures des messages : police + échelle (les polices n'ont pas la même taille apparente) */
.f-caveat { --f-hand: "Caveat", cursive; --hand-k: 1; }
.f-dancing { --f-hand: "Dancing Script", cursive; --hand-k: .86; }
.f-patrick { --f-hand: "Patrick Hand", "Comic Sans MS", cursive; --hand-k: .84; }
.f-kalam { --f-hand: "Kalam", cursive; --hand-k: .78; }
.f-elite { --f-hand: "Special Elite", "Courier New", monospace; --hand-k: .7; }
.f-cormorant { --f-hand: "Cormorant", Georgia, serif; --hand-k: .9; }
.f-cormorant p { font-style: italic; }
.fonts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.font-chip {
  display: flex; flex-direction: column; align-items: center; gap: 0; padding: 8px 4px; cursor: pointer;
  border: 1px solid var(--line); border-radius: 12px; background: var(--bg); color: var(--ink); font: 600 12px var(--f-body);
}
.font-chip span { font-family: var(--f-hand); font-size: calc(30px * var(--hand-k)); line-height: 1.2; }
.font-chip[aria-checked="true"] { border-color: var(--accent); color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--panel)); }

/* La feuille de mémoire encadrée (cadre fin, passe-partout blanc) */
.sheet-section { max-width: 1120px; margin: 0 auto; padding: 52px 0 8px; }
.frame {
  display: block; padding: clamp(6px, 1.2vw, 12px); border-radius: 3px; text-decoration: none;
  background: linear-gradient(145deg, #3a3f47, #1f242b); box-shadow: 0 2px 4px rgba(0, 0, 0, .18), 0 24px 60px rgba(20, 30, 45, .28);
  transition: transform .25s, box-shadow .25s;
}
.frame:hover { transform: translateY(-3px); box-shadow: 0 4px 8px rgba(0, 0, 0, .2), 0 32px 70px rgba(20, 30, 45, .32); }
.frame-mat { display: block; padding: clamp(12px, 3vw, 36px); background: #fdfcf9; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .06), inset 0 2px 6px rgba(0, 0, 0, .12); }
.mini-world { display: block; position: relative; overflow: hidden; box-shadow: 0 1px 3px rgba(0, 0, 0, .15); }
.world.no-img .item img { visibility: hidden; }
.world.no-img .polaroid { background: #e9e4d8; min-height: 160px; }
.world.mini { position: absolute; left: 0; top: 0; transform-origin: 0 0; box-shadow: none; border-radius: 0; pointer-events: none; }
.frame-caption { margin: 14px 0 0; text-align: center; color: var(--muted); font-size: 14px; }

/* Tous les messages : cartes de papier posées */
.feed { max-width: 1120px; margin: 0 auto; padding: 48px 0 24px; scroll-margin-top: 16px; }
.section-head { display: flex; flex-wrap: wrap; gap: 4px 16px; align-items: baseline; justify-content: space-between; margin-bottom: 22px; }
.section-head h2 { font-family: var(--f-display); font-weight: 600; font-size: clamp(32px, 5vw, 42px); margin: 0; }
.feed-grid { columns: 270px; column-gap: 20px; }
.note {
  display: flex; flex-direction: column; gap: 10px; width: 100%; margin: 0 0 20px; break-inside: avoid; min-width: 0;
  padding: 20px 20px 12px; color: var(--paper-ink); background: var(--paper); border: 1px solid var(--paper-line); border-radius: 4px;
  box-shadow: 0 1px 2px rgba(20, 30, 45, .06), 0 8px 22px rgba(20, 30, 45, .07);
  transform: rotate(var(--tilt, 0deg));
}
.note:nth-child(4n + 1) { --tilt: -.6deg; }
.note:nth-child(4n + 2) { --tilt: .5deg; }
.note:nth-child(4n + 3) { --tilt: -.3deg; }
.note.new { animation: arrive .8s ease-out; }
@keyframes arrive { from { transform: translateY(-14px) scale(1.04); box-shadow: 0 0 0 4px var(--candle); } }
.note-video { width: 100%; max-height: 60vh; background: #000; border: 6px solid #fff; box-shadow: 0 2px 10px rgba(0, 0, 0, .15); }
.page-video { display: block; width: 100%; max-height: 300px; max-height: 46cqh; background: #000; }
.video-thumb { position: relative; }
.video-thumb .play {
  position: absolute; left: 50%; top: calc(50% - 9px); width: 54px; height: 54px; transform: translate(-50%, -50%);
  border-radius: 50%; background: rgba(20, 30, 45, .65); box-shadow: 0 0 0 3px rgba(255, 255, 255, .85);
}
.video-thumb .play::after { content: ""; position: absolute; left: 21px; top: 16px; border-style: solid; border-width: 11px 0 11px 18px; border-color: transparent transparent transparent #fff; }
.note-gallery, .page-gallery { display: grid; gap: 6px; }
.note-gallery.n1, .page-gallery.n1 { grid-template-columns: 1fr; }
.note-gallery.n2, .note-gallery.n4, .page-gallery.n2, .page-gallery.n4 { grid-template-columns: 1fr 1fr; }
.note-gallery.n3, .page-gallery.n3, .note-gallery.n6, .page-gallery.n6 { grid-template-columns: 1fr 1fr 1fr; }
.gal-item { padding: 0; border: 5px solid #fff; background: #eef0f3; box-shadow: 0 2px 8px rgba(0, 0, 0, .14); cursor: zoom-in; display: block; }
.gal-item img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; }
.n1 .gal-item { justify-self: center; max-width: 100%; }
.n1 .gal-item img { aspect-ratio: auto; width: auto; max-width: 100%; max-height: 70vh; object-fit: contain; }
.page .n1 .gal-item img { max-height: 46vh; max-height: 50cqh; }
.page-gallery { max-width: 420px; align-self: center; width: 100%; }
.note-photo { width: 100%; height: auto; border: 6px solid #fff; box-shadow: 0 2px 10px rgba(0, 0, 0, .15); background: #eef0f3; }
.note-drawing { align-self: center; max-width: 100%; }
.note-drawing img { max-height: 260px; }
/* Dessin : feuille blanche scotchée, cliquable (le trait coupé au bord reste propre) */
.drawing-frame, .note-drawing {
  position: relative; display: block; padding: 8px; border: 0; border-radius: 2px; cursor: zoom-in; flex-shrink: 0;
  background: #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, .14); transform: rotate(.8deg); transition: transform .15s;
}
.drawing-frame img, .note-drawing img { display: block; width: auto; height: auto; max-width: 100%; }
.drawing-frame:hover, .note-drawing:hover, .gal-item:hover { transform: rotate(0) scale(1.015); }
.note p { margin: 0; font-family: var(--f-hand); font-size: calc(26px * var(--hand-k)); line-height: 1.2; overflow-wrap: anywhere; white-space: pre-line; }
.note .sig { font-family: var(--f-hand); font-weight: 700; font-size: 28px; color: var(--paper-accent); align-self: flex-end; }
.note-sig { height: 54px; width: auto; max-width: 100%; align-self: flex-end; }
.note-who { font-size: 12px; color: var(--paper-muted); align-self: flex-end; margin-top: -6px; }
.note-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding-top: 8px; border-top: 1px dashed var(--paper-line); font-size: 12px; color: var(--paper-muted); }
.note-foot .report { font-size: 12px; color: var(--paper-muted); padding: 2px 0; }
.report.armed { color: var(--danger) !important; font-weight: 700; }
.feed-empty { text-align: center; color: var(--muted); font-size: 17px; padding: 24px 0; margin: 0; }
.feed-more { display: flex; justify-content: center; padding: 8px 0 0; }

/* Livre et affiche : deux cartes d'accès */
.modes { max-width: 1120px; margin: 0 auto; padding: 28px 0 40px; display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; }
.mode-card {
  display: flex; align-items: center; gap: 18px; padding: 18px; min-width: 0; text-decoration: none; color: var(--ink);
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px; transition: transform .2s, box-shadow .2s;
}
.mode-card:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(20, 30, 45, .1); }
.mode-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mode-text b { font-family: var(--f-display); font-size: 25px; font-weight: 600; line-height: 1.15; }
.mode-text span { color: var(--muted); font-size: 15px; }
.mode-visual { flex: none; width: 92px; height: 92px; border-radius: 10px; display: grid; place-items: center; background: var(--bg); }
.mini-cover { width: 56px; height: 72px; border-radius: 3px 6px 6px 3px; background: var(--cover); box-shadow: inset 4px 0 0 rgba(0, 0, 0, .25), 0 4px 10px rgba(0, 0, 0, .2); display: grid; place-items: center; }
.mini-flame { width: 8px; height: 12px; border-radius: 50% / 60% 60% 40% 40%; background: var(--candle); box-shadow: 0 0 8px var(--candle); }
.mini-poster { position: relative; width: 74px; height: 54px; background: var(--paper); border: 1px solid var(--paper-line); box-shadow: 0 4px 10px rgba(0, 0, 0, .12); }
.mini-poster i { position: absolute; width: 16px; height: 3px; border-radius: 2px; background: var(--paper-accent); opacity: .55; }
.mini-poster i:nth-child(1) { left: 8px; top: 10px; transform: rotate(-6deg); }
.mini-poster i:nth-child(2) { right: 8px; top: 12px; transform: rotate(5deg); }
.mini-poster i:nth-child(3) { left: 29px; top: 25px; width: 16px; height: 4px; background: var(--paper-ink); opacity: .8; }
.mini-poster i:nth-child(4) { left: 10px; bottom: 10px; transform: rotate(4deg); }
.mini-poster i:nth-child(5) { right: 10px; bottom: 9px; transform: rotate(-5deg); }

/* Barre de navigation : flottante en bas au centre (ordinateur), barre fixe (téléphone) */
.dock {
  position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 15;
  display: flex; align-items: center; gap: 2px; padding: 4px;
  transition: opacity .25s, transform .25s, visibility .25s; opacity: .92;
  background: color-mix(in srgb, var(--panel) 80%, transparent); backdrop-filter: blur(14px) saturate(1.4); -webkit-backdrop-filter: blur(14px) saturate(1.4);
  border: 1px solid var(--line); border-radius: 999px; box-shadow: 0 6px 20px rgba(20, 30, 45, .14);
}
.dock:hover { opacity: 1; }
/* Accueil tout en haut : la page a déjà ses boutons, la barre s'efface */
body.hero-in-view .dock { opacity: 0; visibility: hidden; transform: translate(-50%, 20px); }
.dock-item {
  display: flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px;
  color: var(--muted); font-weight: 700; font-size: 13px; text-decoration: none; white-space: nowrap; transition: background .15s, color .15s;
}
.dock-item svg, .dock-plus svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.dock-item:hover { color: var(--ink); background: color-mix(in srgb, var(--accent) 8%, transparent); }
.dock-item[aria-current="page"] { color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); }
.dock-write {
  display: flex; align-items: center; gap: 6px; margin: 0 2px; padding: 7px 14px 7px 8px; border: 0; border-radius: 999px; cursor: pointer;
  font: inherit; font-weight: 800; font-size: 13px; color: var(--accent-ink); background: var(--accent); box-shadow: none;
}
.dock-plus { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: rgba(255, 255, 255, .18); }
.dock-write:hover { filter: brightness(1.08); }
/* Le bouton « Laisser un message » de la barre du haut fait doublon avec la barre de navigation */
.top #open { display: none; }


/* Ce que l'on peut laisser */
.how { max-width: 1080px; margin: 0 auto; padding: 32px 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 28px; border-top: 1px solid var(--line); }
.how-item { min-width: 0; display: grid; grid-template-columns: 44px 1fr; gap: 2px 14px; align-items: start; }
.how-item svg {
  grid-row: span 2; width: 44px; height: 44px; padding: 10px; border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 12%, var(--panel)); fill: none; stroke: var(--accent); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round;
}
.how-item h3 { font-family: var(--f-display); font-weight: 600; font-size: 23px; line-height: 1.2; margin: 0; }
.how-item p { margin: 0; color: var(--muted); font-size: 15px; }
.foot {
  margin: 48px -16px 0; padding: 48px 16px calc(120px + env(safe-area-inset-bottom, 0px));
  display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center;
  color: var(--cover-ink); background: linear-gradient(0deg, #24364a 0%, var(--cover) 100%);
}
.foot .flame { width: 14px; height: 22px; margin-bottom: 8px; }
.foot-name { margin: 0; font-family: var(--f-display); font-size: clamp(28px, 5vw, 38px); font-weight: 500; line-height: 1.1; }
.foot-dates { margin: 0; font-family: var(--f-display); font-style: italic; font-size: 20px; opacity: .75; }
.foot-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; width: min(760px, 100%); margin-top: 22px; }
.foot-card {
  display: flex; align-items: center; gap: 16px; padding: 16px 18px; text-align: left; text-decoration: none; color: var(--cover-ink);
  background: rgba(242, 239, 232, .07); border: 1px solid rgba(242, 239, 232, .18); border-radius: 14px; transition: background .2s, transform .2s;
}
.foot-card:hover { background: rgba(242, 239, 232, .13); transform: translateY(-2px); }
.foot-card .mini-poster, .foot-card .mini-cover { flex: none; }
.foot-card-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.foot-card-text b { font-family: var(--f-display); font-size: 23px; font-weight: 600; line-height: 1.15; }
.foot-card-text span { font-size: 14px; opacity: .7; }
.foot-links { display: flex; gap: 10px; margin-top: 14px; font-size: 15px; }
.foot-links a { color: var(--cover-ink); font-weight: 600; text-underline-offset: 4px; text-decoration-color: rgba(242, 239, 232, .4); }
.foot-links span { opacity: .5; }
.foot-note { margin: 10px 0 0; font-size: 13px; opacity: .55; }

/* ========================================================================== */
/* Affiche                                                                    */
/* ========================================================================== */

.stage { position: absolute; inset: 0; overflow: hidden; touch-action: none; cursor: grab; }
.stage.drag { cursor: grabbing; }
.hint-bar {
  position: absolute; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%);
  font-size: 12px; color: var(--muted); background: var(--panel); border: 1px solid var(--line); border-radius: 999px;
  padding: 3px 12px; white-space: nowrap; max-width: calc(100% - 32px); overflow: hidden; text-overflow: ellipsis; pointer-events: none;
  opacity: 0; transition: opacity .4s;
}
.hint-bar.show { opacity: 1; }   /* aide visible quelques secondes à l'ouverture (app.js) */
.hint-phone { display: none; }
.world {
  position: absolute; left: 0; top: 0; width: 2400px; height: 1600px; transform-origin: 0 0;
  background: var(--paper); color: var(--paper-ink); border-radius: 4px; box-shadow: 0 10px 40px rgba(0, 0, 0, .18);
  background-image: radial-gradient(circle at 50% 45%, rgba(224, 164, 58, .07), transparent 55%);
}
/* Double filet autour de la feuille, comme une affiche imprimée */
.world::before, .world::after { content: ""; position: absolute; pointer-events: none; }
.world::before { inset: 34px; border: 2px solid rgba(63, 95, 128, .35); }
.world::after { inset: 44px; border: 1px solid rgba(63, 95, 128, .22); }
.center {
  position: absolute; left: 1200px; top: 800px; width: 460px;
  transform: translate(-50%, -50%) scale(var(--center-k, 1));   /* agrandi sur les grandes feuilles (poster.js) */
  display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center;
}
.portrait { width: 190px; height: 190px; border-radius: 50%; border: 5px solid #fff; overflow: hidden; background: #e6e9ee; box-shadow: 0 6px 24px rgba(0, 0, 0, .12); }
.center .eyebrow { margin-top: 10px; color: var(--paper-muted); font-size: 15px; letter-spacing: .28em; }
.center h1 { font-family: var(--f-display); font-weight: 500; font-size: 76px; line-height: 1; margin: 2px 0 0; }
.center .dates { font-family: var(--f-display); font-style: italic; font-size: 28px; color: var(--paper-muted); }
.center .empty { margin: 8px 0 0; font-family: var(--f-hand); font-size: 30px; color: var(--paper-accent); }

.item {
  position: absolute; transform: translate(-50%, -50%) rotate(var(--r)); width: max-content; max-width: 280px; max-height: 350px; overflow: hidden; cursor: pointer;
  display: flex; flex-direction: column; gap: 6px; color: var(--paper-ink);
}
.item p {
  margin: 0; font-family: var(--f-hand); font-size: calc(30px * var(--hand-k)); line-height: 1.15; overflow-wrap: anywhere; white-space: pre-line;
  display: -webkit-box; -webkit-line-clamp: 7; -webkit-box-orient: vertical; overflow: hidden;   /* 160 caractères : tient en entier */
}
.item.has-media p { -webkit-line-clamp: 4; }
.item .sig { font-family: var(--f-hand); font-weight: 700; font-size: 30px; color: var(--paper-accent); align-self: flex-end; }
.item .who { font-size: 12px; color: var(--paper-muted); align-self: flex-end; }
.item img.sig-img { height: 56px; width: auto; align-self: flex-end; }
.item img.drawing { max-width: 230px; max-height: 150px; width: auto; height: auto; }
.item img.sig-img { height: 46px; }
.item .polaroid { width: 220px; position: relative; }
.polaroid .more { position: absolute; right: 8px; bottom: 30px; padding: 2px 8px; border-radius: 999px; background: rgba(20, 30, 45, .75); color: #fff; font: 700 13px var(--f-body); }
.item.new { animation: pop .7s ease-out; }
@keyframes pop { from { transform: translate(-50%, -50%) rotate(var(--r)) scale(1.6); opacity: 0; } }

.polaroid { background: #fff; padding: 8px 8px 26px; box-shadow: 0 3px 12px rgba(0, 0, 0, .18); width: 230px; max-width: 100%; }
.polaroid img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: #eef0f3; }

/* ========================================================================== */
/* Livre                                                                      */
/* ========================================================================== */

/* Le livre : couverture rigide, pages crème, reliure, tranche, pages qui tournent en 3D */
.bookview { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 16px 16px 96px; touch-action: pan-y; }
.book-stage { width: min(1060px, 100%); height: min(700px, calc(100% - 64px)); display: flex; align-items: center; justify-content: center; perspective: 2400px; min-height: 0; }
.book {
  --board: #22344a; --gold: #d8bd7a; --paper-book: #fbf8f1;
  position: relative; width: 100%; height: 100%; max-height: 100%; display: flex; padding: 12px;
  background: linear-gradient(135deg, #2a3f57, var(--board) 60%, #1b2a3c); border-radius: 10px;
  box-shadow: 0 2px 3px rgba(0, 0, 0, .25), 0 30px 70px rgba(15, 22, 33, .45);
}
/* tranche des pages (feuillets empilés) sur les bords */
.book::before, .book::after { content: ""; position: absolute; top: 14px; bottom: 14px; width: 6px; pointer-events: none;
  background: repeating-linear-gradient(90deg, #e9e3d6 0 1px, #f8f4ec 1px 2px); }
.book::before { left: 7px; border-radius: 3px 0 0 3px; }
.book::after { right: 7px; border-radius: 0 3px 3px 0; }
.book.closed { width: min(50%, 520px); padding: 0; }
.book.closed::before, .book.closed::after, .book.solo-mode::before { display: none; }
.book.solo-mode { width: min(560px, 100%); padding: 10px 12px 10px 10px; }
.book.solo-mode::after { right: 5px; }
/* signet en ruban */
.ribbon { position: absolute; top: -6px; right: 22%; width: 16px; height: 90px; z-index: 3; pointer-events: none;
  background: linear-gradient(90deg, #7d2232, #a3343f 50%, #7d2232); clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 86%, 0 100%); box-shadow: 0 2px 4px rgba(0, 0, 0, .3); }

.spread { position: relative; flex: 1; display: flex; min-width: 0; min-height: 0; transform-style: preserve-3d; }
.page {
  flex: 1; min-width: 0; position: relative; overflow: auto; overscroll-behavior: contain;
  container-type: size;   /* les images se règlent sur la hauteur de la page (cqh) */
  display: flex; flex-direction: column; gap: 14px; padding: 46px 40px 18px;
  color: var(--paper-ink);
  background-color: var(--paper-book);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .45 0 0 0 0 .38 0 0 0 0 .28 0 0 0 .05 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}
/* creux de la reliure : ombre vers le centre */
.page.left { border-radius: 4px 0 0 4px; box-shadow: inset -40px 0 40px -30px rgba(80, 60, 30, .28), inset -1px 0 0 rgba(0, 0, 0, .08); }
.page.right { border-radius: 0 4px 4px 0; box-shadow: inset 40px 0 40px -30px rgba(80, 60, 30, .28); }
.page.solo { border-radius: 4px; box-shadow: inset 26px 0 30px -26px rgba(80, 60, 30, .25); }
.page-head { position: absolute; top: 18px; left: 40px; right: 40px; display: flex; justify-content: space-between; gap: 12px;
  font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: #9a8f7c; pointer-events: none; }
.page-head span:last-child { text-align: right; }
.page p { margin: 0; font-family: var(--f-hand); font-size: calc(29px * var(--hand-k)); line-height: 1.3; overflow-wrap: anywhere; white-space: pre-line; color: #22303f; }
.page .sig { font-family: var(--f-hand); font-weight: 700; font-size: 36px; color: var(--paper-accent); align-self: flex-end; }
.page img.sig-img { height: 70px; width: auto; align-self: flex-end; }
.page .who { font-size: 13px; color: var(--paper-muted); align-self: flex-end; }
.page .drawing-frame { align-self: center; max-width: min(360px, 100%); }
.page .drawing-frame img { max-height: 300px; max-height: 36cqh; }
.page.grouped .drawing-frame img { max-height: 22cqh; }
/* Galeries : largeur limitée par la hauteur de la page pour que tout tienne sans défiler */
.page .page-gallery.n2 { max-width: min(440px, 100cqh); }
.page .page-gallery.n3 { max-width: min(440px, 130cqh); }
.page .page-gallery.n4 { max-width: min(440px, 52cqh); }
.page .page-gallery.n6 { max-width: min(440px, 75cqh); }
/* photos posées sur la page, scotchées */
.page .polaroid, .page-gallery .gal-item { position: relative; }
.page .polaroid { align-self: center; transform: rotate(-1.5deg); flex-shrink: 0; }
.page .polaroid::before, .page-gallery .gal-item:first-child::before {
  content: ""; position: absolute; top: -10px; left: 50%; width: 84px; height: 22px; transform: translateX(-50%) rotate(-3deg); z-index: 1;
  background: rgba(236, 226, 196, .75); box-shadow: 0 1px 2px rgba(0, 0, 0, .08);
}
.page-gallery { max-width: 440px; }
.page-gallery .gal-item:nth-child(even) { transform: rotate(1.2deg); }
.page-gallery .gal-item:nth-child(odd) { transform: rotate(-1deg); }
/* Un ou plusieurs messages par page */
.page-msg { display: flex; flex-direction: column; gap: 12px; }
.page.grouped .page-msg { gap: 6px; }
.page.grouped p { font-size: calc(26px * var(--hand-k)); }
.page.grouped .sig { font-size: 30px; }
.page.grouped img.sig-img { height: 54px; }
.msg-foot { display: flex; justify-content: flex-start; }
.msg-foot:empty { display: none; }
.msg-sep { align-self: center; width: 46%; height: 1px; margin: 4px 0; background: linear-gradient(90deg, transparent, #cdbf9f, transparent); flex: none; }
/* bas de page dans le flux : jamais par-dessus le message */
.page-bottom { margin-top: auto; padding-top: 14px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; }
.page-foot { font-family: var(--f-display); font-style: italic; font-size: 16px; color: #9a8f7c; font-variant-numeric: tabular-nums; }
.page .report { justify-self: start; font-size: 12px; color: #a59a86; padding: 0; }
.page .report.armed { color: var(--danger); font-weight: 700; }
.page.blank { background-image: none; }

/* Couverture : toile bleu nuit, cadre et titre dorés, médaillon */
.page.coverpage {
  border-radius: 6px 10px 10px 6px; align-items: center; justify-content: safe center; text-align: center;
  gap: clamp(4px, 1.6cqh, 10px); padding: clamp(36px, 8cqh, 48px) 44px;
  color: var(--gold, #d8bd7a);
  background-color: #22344a;
  background-image:
    radial-gradient(ellipse at 50% 40%, rgba(255, 255, 255, .07), transparent 60%),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, .025) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(90deg, rgba(0, 0, 0, .06) 0 1px, transparent 1px 3px);
  box-shadow: inset 10px 0 18px -6px rgba(0, 0, 0, .55), inset -1px 0 0 rgba(255, 255, 255, .06), 0 20px 50px rgba(0, 0, 0, .35);
}
.page.coverpage::before, .page.coverpage::after { content: ""; position: absolute; pointer-events: none; border: 1.5px solid rgba(216, 189, 122, .75); border-radius: 4px; }
.page.coverpage::before { inset: 22px 22px 22px 30px; }
.page.coverpage::after { inset: 30px 30px 30px 38px; border-width: .5px; }
.coverpage .eyebrow { font-family: var(--f-body); font-size: 12px; letter-spacing: .32em; color: rgba(216, 189, 122, .85); margin: 4px 0 0; }
.coverpage h2 {
  font-family: var(--f-display); font-weight: 600; font-size: clamp(34px, min(5.5vw, 9cqh), 58px); line-height: 1.02; margin: 0;
  background: linear-gradient(180deg, #f3e2b0 0%, #d8bd7a 45%, #b8964f 100%); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 1px 0 rgba(0, 0, 0, .35));
}
.coverpage .dates { font-family: var(--f-display); font-style: italic; font-size: clamp(18px, 3.6cqh, 24px); color: rgba(216, 189, 122, .85); }
.coverpage .portrait { flex-shrink: 0; align-self: center; width: clamp(80px, 21cqh, 150px); height: auto; aspect-ratio: 150 / 186; border-radius: 50%; border: 3px solid rgba(216, 189, 122, .9); box-shadow: 0 0 0 6px rgba(216, 189, 122, .15), 0 10px 26px rgba(0, 0, 0, .4); }
.coverpage .flame { margin: 0; flex-shrink: 0; }
/* Couverture très basse (petit téléphone) : on garde l'essentiel — photo, nom, dates, bouton */
@container (max-height: 420px) {
  .coverpage .flame, .coverpage .eyebrow { display: none; }
  .coverpage h2 { font-size: 30px; }
  .coverpage .portrait { width: clamp(64px, 18cqh, 90px); }
  .page.coverpage { gap: 4px; }
  .coverpage .dates { font-size: 17px; }
}
.cover-count { font-size: 13px; color: rgba(242, 239, 232, .7); }
.cover-cta { display: flex; flex-direction: column; align-items: center; gap: 6px; margin-top: clamp(2px, 1.5cqh, 10px); position: relative; z-index: 2; }
.cover-btn { background: linear-gradient(180deg, #e9d29a, #c9a961); color: #1f2a3a; box-shadow: 0 6px 18px rgba(0, 0, 0, .3); }
.cover-link { color: rgba(242, 239, 232, .85); font-weight: 600; font-size: 15px; text-decoration: none; }
.cover-link:hover { color: #fff; text-decoration: underline; }

/* Page de fin */
.page.endpage { align-items: center; justify-content: center; text-align: center; gap: 12px; }
.endpage .flame { margin-bottom: 6px; }
.endpage h3 { font-family: var(--f-display); font-weight: 500; font-size: 34px; margin: 0; color: #22303f; }
.page.endpage p { font-family: var(--f-body); font-size: 15px; line-height: 1.6; color: #6f6656; max-width: 30ch; }

/* Page qui tourne */
.flipper { position: absolute; top: 0; bottom: 0; width: 50%; z-index: 5; transform-style: preserve-3d; pointer-events: none; }
.flipper.to-left { left: 50%; transform-origin: left center; animation: flipToLeft .85s cubic-bezier(.45, .05, .25, 1) forwards; }
.flipper.to-right { left: 0; transform-origin: right center; animation: flipToRight .85s cubic-bezier(.45, .05, .25, 1) forwards; }
.flipper .face { position: absolute; inset: 0; display: flex; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.flipper .face > .page { height: 100%; overflow: hidden; }
.flipper .back { transform: rotateY(180deg); }
.flipper .face::after { content: ""; position: absolute; inset: 0; pointer-events: none; animation: flipShade .85s ease-in-out forwards; }
.flipper.to-left .front::after { background: linear-gradient(90deg, rgba(0, 0, 0, .25), transparent 60%); }
.flipper.to-right .front::after { background: linear-gradient(270deg, rgba(0, 0, 0, .25), transparent 60%); }
@keyframes flipToLeft { to { transform: rotateY(-180deg); } }
@keyframes flipToRight { to { transform: rotateY(180deg); } }
@keyframes flipShade { 0% { opacity: 0; } 50% { opacity: 1; } 100% { opacity: 0; } }
.flip-under { position: absolute; top: 0; bottom: 0; width: 50%; z-index: 4; display: flex; pointer-events: none; }
.flip-under.on-left { left: 0; }
.flip-under.on-right { left: 50%; }
.flip-under > .page { height: 100%; overflow: hidden; }
/* Téléphone : la page se soulève et part sur le côté */
.peel { position: absolute; inset: 0; z-index: 5; display: flex; pointer-events: none; }
.peel > .page { height: 100%; overflow: hidden; }
.peel.to-left { transform-origin: left center; animation: peelLeft .55s ease-in forwards; }
.peel.to-right { transform-origin: right center; animation: peelRight .55s ease-in forwards; }
@keyframes peelLeft { to { transform: rotateY(-100deg); opacity: .3; } }
@keyframes peelRight { to { transform: rotateY(100deg); opacity: .3; } }
.book.opening { animation: bookOpen .5s ease-out; }
@keyframes bookOpen { from { opacity: .4; transform: scale(.97); } }

/* Navigation : flèches et réglette pour aller à n'importe quelle page */
.book-nav { display: flex; align-items: center; gap: 12px; width: min(620px, 100%); }
.book-arrow { width: 44px; height: 44px; font-size: 24px; flex: none; }
.scrub { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.scrub input { padding: 0; height: 22px; background: transparent; border: 0; accent-color: var(--accent); width: 100%; }
.scrub span { text-align: center; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ========================================================================== */
/* Formulaire de dépôt (plein écran sur téléphone, fenêtre sur ordinateur)    */
/* ========================================================================== */

.sheet-form {
  position: fixed; inset: 0; z-index: 20; padding: 24px 16px;
  display: grid; place-items: center; overflow: auto;
  background: color-mix(in srgb, var(--bg) 78%, transparent); backdrop-filter: blur(3px);
}
.sheet-form form {
  width: min(620px, 100%); max-height: 100%; display: flex; flex-direction: column;
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 20px 60px rgba(0, 0, 0, .18); overflow: hidden;
}
.form-head { display: grid; grid-template-columns: 40px 1fr 40px; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.form-head h2 { text-align: center; font-size: 26px; }
.form-body { display: flex; flex-direction: column; gap: 8px; padding: 18px 20px; overflow-y: auto; }
.form-foot { display: flex; align-items: center; justify-content: flex-end; gap: 12px; padding: 12px 20px calc(12px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line); background: var(--panel); }
.form-foot .status { flex: 1; font-size: 14px; }
h2 { font-family: var(--f-display); font-weight: 600; font-size: 30px; margin: 0; }
label { font-weight: 700; font-size: 14px; margin-top: 6px; }
.opt { font-weight: 400; color: var(--muted); }
.hint { font-size: 13px; color: var(--muted); margin: 0; }
.counter { align-self: flex-end; font-variant-numeric: tabular-nums; }
.consent { margin-top: 10px; }
input, textarea, select {
  font: inherit; font-size: 16px; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 10px;
  padding: 12px 14px; width: 100%;
}
#text { font-family: var(--f-hand); font-size: calc(24px * var(--hand-k)); line-height: 1.25; min-height: 150px; resize: vertical; }
.add-title { margin: 10px 0 0; font-weight: 700; font-size: 14px; }
.add-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(72px, 1fr)); gap: 8px; }
.chip {
  font: inherit; font-size: 14px; font-weight: 600; display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 12px 6px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); color: var(--ink); cursor: pointer;
}
.chip svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.chip[aria-expanded="true"] { border-color: var(--accent); color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--panel)); }
.chip.done::after { content: "✓"; font-size: 12px; color: var(--ok); }
.extra { display: flex; flex-direction: column; gap: 6px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; }
.extra label { margin-top: 0; }
canvas {
  width: 100%; display: block; background: var(--paper); border: 1px dashed var(--line); border-radius: 10px;
  touch-action: none; cursor: crosshair;
}
#draw { aspect-ratio: 1 / 1; max-height: 60vh; }
#sign { aspect-ratio: 5 / 2; }
.photo-drop {
  aspect-ratio: 4 / 3; display: grid; place-items: center; text-align: center; overflow: hidden; padding: 8px; margin-top: 0;
  border: 1px dashed var(--line); border-radius: 10px; background: var(--bg); color: var(--muted);
  font-size: 15px; font-weight: 600; cursor: pointer;
}
.photo-drop img { width: 100%; height: 100%; object-fit: contain; }
.photo-drop.over { border-color: var(--accent); }
.pick-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pick { font-size: 14px; padding: 11px 10px; margin: 0; cursor: pointer; }
.pick svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.pick.disabled { opacity: .4; pointer-events: none; }
.shots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.shot { position: relative; }
.shot img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; }
.shot-remove { position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: rgba(20, 30, 45, .75); color: #fff; font-size: 13px; cursor: pointer; }
#extra-photo.over { border-color: var(--accent); }
.video-drop { aspect-ratio: 4 / 3; border-radius: 10px; overflow: hidden; background: #000; }
.video-drop video { width: 100%; height: 100%; object-fit: contain; background: #000; }
.progress { height: 6px; border-radius: 999px; background: var(--line); overflow: hidden; }
.progress span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }
input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.swatch { width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--line); cursor: pointer; padding: 0; }
.swatch[aria-pressed="true"] { border-color: var(--ink); box-shadow: 0 0 0 2px var(--panel) inset; }
.status { color: var(--accent); font-weight: 600; }
.status.error { color: var(--danger); }
.trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ========================================================================== */
/* Code d'accès                                                               */
/* ========================================================================== */

.gate { position: absolute; inset: 0; z-index: 6; display: grid; place-items: center; padding: 16px; background: var(--bg); overflow: auto; }
.gate-card {
  width: min(420px, 100%); display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center;
  padding: 36px 28px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
}
.gate-card h1 { font-family: var(--f-display); font-weight: 600; font-size: 44px; line-height: 1.05; margin: 0; }
.gate-card input { text-align: center; font-size: 18px; letter-spacing: .08em; }

.viewer {
  position: fixed; inset: 0; z-index: 30; background: rgba(8, 12, 18, .94); display: grid; place-items: center;
  padding: calc(56px + env(safe-area-inset-top, 0px)) 12px calc(48px + env(safe-area-inset-bottom, 0px)); touch-action: pan-y;
}
.viewer img {
  /* l'image tient toujours entière dans l'écran (hauteur de la fenêtre moins les marges haut et bas) */
  width: auto; height: auto; max-width: 100%; object-fit: contain; box-shadow: 0 10px 40px rgba(0, 0, 0, .5);
  max-height: calc(100vh - 104px);
  max-height: calc(100dvh - 104px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
}
/* ordinateur : place pour les flèches de chaque côté */
@media (min-width: 721px) { .viewer { padding-left: 84px; padding-right: 84px; } }
.viewer img.on-paper { background: #fff; padding: 16px; }
.viewer-close, .viewer-nav {
  position: absolute; border: 0; cursor: pointer; color: #fff; background: rgba(255, 255, 255, .12);
  width: 46px; height: 46px; border-radius: 50%; font-size: 22px; display: grid; place-items: center;
}
.viewer-close { top: calc(10px + env(safe-area-inset-top, 0px)); right: 12px; }
.viewer-nav { top: 50%; transform: translateY(-50%); font-size: 30px; }
.viewer-nav.prev { left: 10px; }
.viewer-nav.next { right: 10px; }
.viewer-count { position: absolute; bottom: calc(14px + env(safe-area-inset-bottom, 0px)); left: 0; right: 0; margin: 0; text-align: center; color: rgba(255, 255, 255, .8); font-size: 14px; }

/* Recherche dans les messages */
.feed-search { position: relative; max-width: 420px; margin: -6px 0 22px; }
.feed-search svg { position: absolute; left: 14px; top: 50%; width: 20px; height: 20px; transform: translateY(-50%); fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; }
.feed-search input { padding-left: 44px; border-radius: 999px; background: var(--panel); }

/* ========================================================================== */
/* Messages flottants                                                         */
/* ========================================================================== */

/* Fenêtres : fiche d'un message, remerciement (centrées sur ordinateur, tiroir du bas sur téléphone) */
.modal {
  position: fixed; inset: 0; z-index: 28; display: grid; place-items: center; padding: 16px;
  background: rgba(8, 12, 18, .62); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
}
.modal-box {
  position: relative; width: min(520px, 100%); max-height: calc(100dvh - 32px); overflow: auto; overscroll-behavior: contain;
  background: var(--panel); color: var(--ink); border-radius: 16px; padding: 22px; box-shadow: 0 20px 60px rgba(0, 0, 0, .35);
  animation: modalIn .22s ease-out;
}
@keyframes modalIn { from { opacity: 0; transform: translateY(16px) scale(.98); } }
.modal-close {
  position: absolute; top: 10px; right: 10px; z-index: 2; width: 40px; height: 40px; border: 0; border-radius: 50%;
  background: color-mix(in srgb, var(--ink) 8%, transparent); color: var(--ink); font-size: 18px; cursor: pointer;
}
.modal-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 16px; }
.modal-actions.column { flex-direction: column; align-items: stretch; }
.card-box { padding-top: 56px; }
.card-box .note { margin: 0; transform: none; }
.card-box .note p { font-size: calc(30px * var(--hand-k)); }
.thanks-box { text-align: center; padding-top: 30px; }
.thanks-box .flame { margin: 0 auto 6px; }
.thanks-box h2 { font-family: var(--f-display); font-weight: 600; font-size: 38px; margin: 0; }
.thanks-box p { margin: 6px auto 0; max-width: 36ch; color: var(--muted); line-height: 1.5; }
.share-ico { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; margin-right: 8px; }
.share-btn {
  margin-top: 18px; padding: 11px 20px; border-radius: 999px; cursor: pointer; font: inherit; font-weight: 700; font-size: 15px;
  color: var(--cover-ink); border: 1px solid color-mix(in srgb, var(--cover-ink) 35%, transparent); background: color-mix(in srgb, var(--cover-ink) 8%, transparent);
}
.share-btn:hover { background: color-mix(in srgb, var(--cover-ink) 16%, transparent); }

.toast {
  position: fixed; left: 50%; top: 16px; transform: translateX(-50%); z-index: 7; max-width: calc(100% - 32px);
  background: var(--panel); color: var(--ink); border: 1px solid var(--line); border-radius: 10px;
  padding: 12px 18px; font-weight: 600; box-shadow: 0 8px 28px rgba(0, 0, 0, .16);
}
.noscript { position: fixed; inset: auto 16px 16px; background: var(--panel); padding: 12px; border-radius: 8px; }

/* ========================================================================== */
/* Administration                                                             */
/* ========================================================================== */

body.admin-page { overflow: auto; }
.admin { max-width: 1000px; margin: 0 auto; padding: 24px 16px 48px; display: grid; gap: 20px; }
.stack { display: grid; gap: 20px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label { margin-top: 4px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 22px; display: grid; gap: 14px; }
.card h3 { font-size: 15px; margin: 4px 0 0; }
.login { max-width: 400px; width: 100%; justify-self: center; }
.settings { display: grid; grid-template-columns: 1fr 210px; gap: 18px; }
.portrait-edit { display: flex; flex-direction: column; gap: 8px; align-items: center; }
.portrait-edit .portrait { width: 170px; height: 170px; border-color: var(--line); }
.choices { display: grid; gap: 8px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; cursor: pointer; }
.check input { width: auto; margin-top: 5px; }
.check b { display: block; }
.check .hint { display: block; }
/* Sections de l'administration (onglets collés en haut de l'écran) */
.admin-nav {
  position: sticky; top: 0; z-index: 5; display: flex; gap: 6px; overflow-x: auto; padding: 8px 0; scrollbar-width: none;
  background: var(--bg);
}
.admin-nav button {
  flex: none; font: inherit; font-weight: 700; font-size: 15px; padding: 9px 16px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line); background: var(--panel); color: var(--muted); display: inline-flex; align-items: center; gap: 8px;
}
.admin-nav button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.badge { min-width: 22px; padding: 1px 7px; border-radius: 999px; background: var(--danger); color: #fff; font-size: 12px; text-align: center; }
/* Messages : outils, pagination */
.msg-tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; }
.msg-tools input[type="search"] { flex: 1 1 240px; max-width: 360px; }
.pager-info { margin: 0; color: var(--muted); font-size: 14px; }
.pager { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; align-items: center; }
.pager button { font: inherit; min-width: 40px; padding: 7px 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); cursor: pointer; }
.pager button[aria-current="page"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 700; }
.pager button:disabled { opacity: .4; cursor: default; }
.pager .gap { color: var(--muted); padding: 0 2px; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.date-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.date-row > div { display: grid; gap: 6px; }
.tabs button { font: inherit; font-size: 14px; font-weight: 600; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); color: var(--muted); padding: 6px 14px; cursor: pointer; }
.tabs button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.list { display: grid; gap: 10px; }
.msg-row { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: start; padding: 12px; border: 1px solid var(--line); border-radius: 8px; }
.msg-row .thumbs { display: flex; gap: 6px; }
.msg-row .thumbs { flex-wrap: wrap; }
.msg-row .thumbs img { width: 72px; height: 72px; object-fit: contain; background: var(--paper); border-radius: 4px; border: 1px solid var(--line); }
.msg-row .thumbs video { width: 180px; max-height: 240px; background: #000; border-radius: 4px; }
.msg-row .body { min-width: 0; }
.msg-row .body p { margin: 4px 0 0; white-space: pre-line; overflow-wrap: anywhere; }
.msg-row time { color: var(--muted); font-size: 13px; margin-left: 6px; }
.msg-row .actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.pill { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; border-radius: 999px; padding: 1px 8px; margin-left: 6px; background: var(--candle); color: #1f2a3a; }
.pill.red { background: var(--danger); color: #fff; }
.empty-list { color: var(--muted); margin: 0; }
.danger-zone { border-color: var(--danger); }
.album-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.album-item { position: relative; }
.album-item img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 6px; }
.shot-remove.armed { background: var(--danger); }
#albumInput { position: absolute; width: 1px; height: 1px; opacity: 0; }

/* ========================================================================== */
/* Téléphone                                                                  */
/* ========================================================================== */

@media (max-width: 720px) {
  /* Couverture sur téléphone : bouton sur une ligne, éléments plus compacts */
  .cover-btn { white-space: nowrap; font-size: 15px; padding: 12px 22px; }
  .coverpage .flame { transform: scale(.75); }
  .coverpage .eyebrow { font-size: 11px; }
  .page.coverpage { padding: clamp(30px, 7cqh, 44px) 30px; }
  body.hero-in-view .dock, .dock {
    opacity: 1; visibility: visible;
    left: 0; right: 0; bottom: 0; transform: none; border-radius: 0; border: 0; border-top: 1px solid var(--line);
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px)); gap: 0; justify-content: space-around; box-shadow: 0 -6px 24px rgba(20, 30, 45, .1);
  }
  .dock-item { flex: 1; flex-direction: column; gap: 2px; padding: 6px 2px; font-size: 11px; border-radius: 12px; }
  .dock-item[aria-current="page"] { background: transparent; }
  .dock-write { flex: 1; flex-direction: column; gap: 2px; margin: 0; padding: 0 2px 6px; background: transparent; box-shadow: none; color: var(--accent); font-size: 11px; font-weight: 800; }
  .dock-plus {
    width: 54px; height: 54px; margin-top: -26px; background: var(--accent); color: var(--accent-ink);
    box-shadow: 0 8px 20px color-mix(in srgb, var(--accent) 45%, transparent), 0 0 0 5px var(--panel);
  }
  .dock-plus svg { width: 26px; height: 26px; stroke-width: 2.2; }
  .dock-item svg { width: 22px; height: 22px; }
  .hint-bar { bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }
  .bookview { padding-bottom: calc(86px + env(safe-area-inset-bottom, 0px)) !important; }
  body.public .top { gap: 8px; }
  /* Feuille sur téléphone : on pince pour zoomer ; un seul bouton « Tout voir » ; aide courte */
  body.public #zoomIn, body.public #zoomOut { display: none; }
  .hint-desk { display: none; }
  /* Fenêtres en tiroir, glissées depuis le bas */
  .modal { place-items: end stretch; padding: 0; }
  .modal-box {
    width: 100%; max-height: 88dvh; border-radius: 18px 18px 0 0; padding-bottom: calc(22px + env(safe-area-inset-bottom, 0px));
    animation: sheetUp .26s ease-out;
  }
  @keyframes sheetUp { from { transform: translateY(100%); } }
  /* Accueil : la barre du bas s'efface quand on descend, revient quand on remonte */
  .dock { transition: transform .25s ease; }
  body.dock-away .dock { transform: translateY(110%); }
  .hint-phone { display: inline; }
  .sheet-form { padding: 0; place-items: stretch; }
  .bookview { padding-bottom: calc(92px + env(safe-area-inset-bottom, 0px)); }
  .foot { padding-bottom: calc(110px + env(safe-area-inset-bottom, 0px)); }
  .book-stage { height: calc(100% - 70px); }
  .page { padding: 44px 22px 14px; }
  .page-head { left: 22px; right: 22px; justify-content: center; }
  .page-head span:first-child { display: none; }   /* sur téléphone : la date seule */
  .ribbon { right: 18px; height: 56px; width: 13px; }
  .sheet-form form { width: 100%; max-height: none; height: 100%; border: 0; border-radius: 0; }
  .top-title { font-size: 19px; }
  .hero-btn { width: 100%; max-width: 360px; }
  /* Accueil : tout le premier écran tient au-dessus de la barre du bas, tailles réglées sur la hauteur */
  .hero {
    min-height: calc(100vh - 72px); min-height: calc(100dvh - 72px - env(safe-area-inset-bottom, 0px));
    justify-content: center; gap: clamp(4px, 1.2vh, 10px);
    padding-top: calc(clamp(20px, 5vh, 48px) + env(safe-area-inset-top, 0px)); padding-bottom: clamp(20px, 4vh, 40px);
  }
  .hero-portrait { width: clamp(96px, 22vh, 170px); margin-bottom: clamp(4px, 1vh, 14px); }
  .hero h1 { font-size: clamp(38px, min(11vw, 7vh), 64px); }
  .hero .lead { font-size: 15px; line-height: 1.45; margin: 0; }
  .hero-candle { --c: 1.9px; margin: clamp(8px, 1.6vh, 18px) 0 2px; }
  .hero-scroll { display: none; }   /* téléphone : le nombre de mots est affiché plus bas (section des messages) */
}
/* Téléphone peu haut : la cagnotte est juste en dessous (carte « Je participe »), la flamme s'efface */
@media (max-width: 720px) and (max-height: 760px) {
  .hero-support { display: none; }
  .hero-candle { --c: 1.25px; margin: 2px 0 0; }   /* la bougie reste allumée, plus petite */
  .candle-caption { margin: 0 0 2px; font-size: 14px; }
  .hero-day { margin-bottom: 6px; font-size: 16px; }
}
/* Très petit téléphone (iPhone SE avec barres du navigateur) */
@media (max-width: 720px) and (max-height: 620px) {
  .hero-portrait { width: clamp(64px, 14vh, 96px); margin-bottom: 0; }
  .hero .eyebrow { display: none; }
  .hero h1 { font-size: 34px; }
  .hero-candle { --c: 1px; }
  .hero-portrait { width: clamp(76px, 15vh, 130px); }
  .hero .eyebrow { margin: 0; }
  .settings { grid-template-columns: 1fr; }
  .msg-row { grid-template-columns: 1fr; }
  .msg-row .actions { justify-content: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  .hero-scroll svg, .note.new,
  .flame, .item.new, .flipper, .peel, .book.opening { animation: none; }
  .note, .btn { transition: none; }
}
