:root { --gutter: clamp(14px, 2.2vw, 34px); --red: #ff1919; }
.caption-dark { --caption-color: #000; }
* { box-sizing: border-box; }
body { margin: 0; color: #151515; background: white; font: 400 clamp(14px,1.1vw,19px)/1.45 Helvetica,Arial,sans-serif; }
a { color: inherit; text-decoration: none; }
button,input { font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid #3983ff; outline-offset: 3px; }
.mascot { position: fixed; z-index: 10; top: 12px; left: 50%; transform: translateX(-50%); }
.logo { border: 0; padding: 4px; background: none; }
.logo img { display: block; width: clamp(56px,6vw,86px); height: clamp(56px,6vw,86px); object-fit: contain; }
.cloud { position: absolute; background: #fff; color: #151515; box-shadow: 0 5px 28px #0003; }
.site-menu {
  position: fixed; z-index: 11; top: calc(20px + clamp(56px, 6vw, 86px)); left: 50%;
  transform: translateX(-50%);
  display: grid; gap: 12px; min-width: min(235px, calc(100vw - 24px));
  padding: 18px 22px; background: #fff; color: #151515;
  font-size: inherit; text-align: center; text-transform: uppercase;
}
.site-menu[hidden], .cloud[hidden] { display: none; }
.site-menu a, .site-menu button {
  display: block; width: fit-content; margin: 0 auto; padding: 2px 4px; border: 0; background: none; text-align: center; color: inherit;
}
.site-menu .menu-fun {
  color: #d40088;
  background: repeating-linear-gradient(160deg, #ff149a 0 2px, #2155ff 3px 5px, #ed142f 6px 8px, #ff149a 9px);
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 700;
}
.cloud :focus-visible { outline-color: #777; }
.site-menu :is(a, button):active { color: #999; }
.cloud { left: 50%; top: calc(100% + 8px); transform: translateX(-50%); }
.cloud { width: min(365px,calc(100vw - 36px)); border-radius: 24px; padding: 20px; }
.cloud h2 { margin: 0 30px 4px 0; font: inherit; }
.cloud-close { position: absolute; top: 12px; right: 14px; background: none; border: 0; font-size: 23px; }
.thread { display: flex; flex-direction: column; gap: 8px; max-height: min(40vh,285px); overflow: auto; margin: 12px 0; }
.thread p { align-self: flex-start; max-width: 85%; padding: 7px 11px; border-radius: 17px; background: #efefef; margin: 0; overflow-wrap: anywhere; }
.thread .visitor { align-self: flex-end; background: #dce9ff; }
.texto-form { display: flex; align-items: center; gap: 6px; }
.texto-form input { min-width: 0; flex: 1; padding: 8px 4px; border: 0; border-radius: 0; background: transparent; color: inherit; }
.texto-form input::placeholder { color: #707070; opacity: 1; }
.texto-form input:focus { outline: none; background: #f5f5f5; }
.texto-form button { flex: none; padding: 6px 3px; border: 0; background: transparent; color: #666; font-size: .9em; }
.texto-form button:focus-visible { outline: none; text-decoration: underline; }
.site-dialog { width: min(435px,calc(100% - 32px)); border: 0; padding: 24px; }
.site-dialog::backdrop { background: #0007; }
.site-dialog h2 { font: inherit; }

.site-menu:not([hidden]), .cloud:not([hidden]) { animation: menu-in .23s ease-out both; }
@keyframes menu-in { from { opacity: 0; translate: 0 -6px; } to { opacity: 1; translate: 0 0; } }
.cloud-close { display: grid; place-items: center; width: 36px; height: 36px; padding: 0; color: inherit; background: transparent; }
.site-dialog form[method="dialog"] button { background: transparent; border: 0; color: inherit; font-size: 22px; cursor: pointer; }
@media (prefers-reduced-motion: reduce) { .site-menu:not([hidden]), .cloud:not([hidden]) { animation: none; } }
.cloud.docked { position: fixed; transform: none; }
.texto-handle { display: flex; align-items: center; justify-content: center; gap: .35em; width: 100%; padding: 0; border: 0; background: none; color: inherit; cursor: grab; touch-action: none; user-select: none; }
.texto-handle:active { cursor: grabbing; }
.back-arrow { position: absolute; z-index: 9; top: var(--gutter); left: var(--gutter); display: grid; place-items: center; width: 44px; height: 44px; font-size: 25px; color: #151515; background: #fffd; text-decoration: none; }
.back-arrow:hover { text-decoration: none; }
.back-arrow svg { display: block; width: 32px; height: 26px; }
.cloud-close svg { display: block; width: 20px; height: 20px; }
.back-arrow svg, .cloud-close svg { stroke-width: 2; }
.cloud { position: fixed; z-index: 12; inset: auto var(--gutter) calc(var(--gutter) + 48px) auto; transform: none; }
.cloud.docked { right: auto; bottom: auto; }
a:hover, .slide:hover span, .fun-card:hover span, .fun-card:focus-visible span { text-decoration: none; }
a:active, button:active, .fun-card:active span, .slide:active span { color: #c7c7c7; text-decoration: none; }
.panel-heading { display: grid; grid-template-columns: 24px minmax(0, 1fr) 24px; align-items: center; gap: 9px; margin-bottom: 12px; }
.panel-heading h2 { margin: 0; font: inherit; font-weight: 700; }
.panel-heading form { margin: 0; }
.panel-heading .cloud-close { position: static; width: auto; height: auto; }
.site-footer { display: flex; flex-wrap: wrap; gap: 8px 16px; padding: 16px var(--gutter) 74px; font-size: .8em; color: #555; border-top: 1px solid #aaa5; }
.site-footer a { color: inherit; }
.site-footer a:focus-visible { outline-offset: 3px; }
.thread a { color: #626262; }
.thread a:active { color: #aaa; text-decoration: none; }
.cloud { top: calc(var(--gutter) + 48px); bottom: auto; }
.site-footer { justify-content: center; text-align: center; padding: 16px var(--gutter) max(14px, env(safe-area-inset-bottom)); border-top: 0; color: #999; }

:is(.photo-row, .project-opening, .recommendation-grid) .photo img.aligned-crop,
:is(.photo-row, .project-opening, .recommendation-grid) img.aligned-crop {
  width: var(--crop-width);
  height: var(--crop-height);
  margin-inline: auto;
  object-fit: cover;
  object-position: center;
}

/* ---- Détails ---- */
::selection { background: var(--red); color: #fff; }
img, video { -webkit-user-drag: none; -webkit-touch-callout: none; user-select: none; }
@media (hover: hover) and (pointer: fine) {
  html.has-emoji-cursor, html.has-emoji-cursor :is(a, button, .photo, label, summary, [role="button"], .fun-card, .logo) { cursor: var(--emoji-cursor), auto; }
  html.has-emoji-cursor input { cursor: text; }
}
@media (prefers-reduced-motion: no-preference) {
  main:not(.slides) { animation: page-in .5s cubic-bezier(.2,.7,.2,1) both; }
  @keyframes page-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
  .reveal { opacity: 0; transform: translateY(28px); transition: opacity .9s cubic-bezier(.16,1,.3,1), transform .9s cubic-bezier(.16,1,.3,1); }
  .reveal.is-in { opacity: 1; transform: none; }
  .site-menu a, .site-menu button { transition: color .2s ease, background-color .2s ease, letter-spacing .3s cubic-bezier(.16,1,.3,1); }
  .site-menu :is(a, button):not(.menu-fun):hover { color: #fff; background: var(--red); box-decoration-break: clone; -webkit-box-decoration-break: clone; }
  .logo img { transition: transform .35s cubic-bezier(.34,1.56,.64,1); }
  .logo:hover img { transform: rotate(-6deg) scale(1.06); }
  .cloud:not([hidden]) { animation: texto-in .45s cubic-bezier(.16,1,.3,1) both; }
  @keyframes texto-in { from { opacity: 0; transform: translateY(14px) scale(.97); } to { opacity: 1; transform: none; } }
}
.project-page .site-footer { display: none; }

/* Typographie : pas de césure, lignes équilibrées */
html { hyphens: manual; -webkit-hyphens: manual; }
p, dd, dt, li, .project-description, .cv-description { text-wrap: pretty; overflow-wrap: normal; }
h1, h2, h3, .info-intro p, .thread p, .project-index span, .viewer-counter { text-wrap: balance; }
.site-menu :is(a, button):not(.menu-fun):hover { color: #fff; background: var(--red); }
