/* ==========================================================================
   Feuille de style du site vitrine.

   Les matières viennent du jeu : nuit marine, chêne du pont, laiton, parchemin,
   et la police des titres du jeu, Pirata One. Un seul moment animé : la donne
   des cartes en haut de l'accueil.

   Mobile d'abord. Les tailles sont fluides (clamp) ; les @media (min-width)
   ne servent qu'aux changements de structure de page, les @container aux
   composants qui dépendent de la place qu'on leur donne.
   ========================================================================== */

/* ---------- Polices (auto-hébergées, licence SIL OFL) ---------- */

@font-face {
  font-family: "Pirata One";
  src: url("../fonts/pirata-one-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Pirata One";
  src: url("../fonts/pirata-one-latin-ext-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Alegreya";
  src: url("../fonts/alegreya-latin-wght-normal.woff2") format("woff2-variations"),
       url("../fonts/alegreya-latin-wght-normal.woff2") format("woff2");
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Alegreya";
  src: url("../fonts/alegreya-latin-ext-wght-normal.woff2") format("woff2-variations"),
       url("../fonts/alegreya-latin-ext-wght-normal.woff2") format("woff2");
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Alegreya";
  src: url("../fonts/alegreya-latin-wght-italic.woff2") format("woff2-variations"),
       url("../fonts/alegreya-latin-wght-italic.woff2") format("woff2");
  font-weight: 400 900;
  font-style: italic;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Alegreya";
  src: url("../fonts/alegreya-latin-ext-wght-italic.woff2") format("woff2-variations"),
       url("../fonts/alegreya-latin-ext-wght-italic.woff2") format("woff2");
  font-weight: 400 900;
  font-style: italic;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ---------- Jetons ---------- */

:root {
  /* Matières */
  --nuit: #0f1d2e;          /* fond : mer de nuit */
  --abysse: #0a1420;        /* bandes profondes, pied de page */
  --houle: #15283d;         /* panneaux posés sur la nuit */
  --laiton: #d4a24c;        /* titres, filets, accents */
  --laiton-clair: #f1cf85;
  --laiton-sombre: #8a6424;
  --ivoire: #f4e8c8;        /* texte sur fond sombre (libellés du jeu) */
  --ivoire-doux: #c9bfa6;   /* texte secondaire sur fond sombre */
  --parchemin: #e9d6aa;
  --parchemin-clair: #f6ecd2;
  --encre: #2b1b0f;         /* texte sur parchemin */
  --encre-douce: #5a4430;
  --chene: #6a4325;         /* bois du pont (valeurs du menu du jeu) */
  --chene-fonce: #2e1b0e;
  --chene-clair: #9c6b40;
  --sang: #9e2c1d;          /* encre rouge des avis de recherche, erreurs */

  /* Typographie */
  --f-display: "Pirata One", "Old English Text MT", Georgia, serif;
  --f-text: "Alegreya", Georgia, "Times New Roman", serif;
  --t-small: clamp(0.95rem, 0.92rem + 0.12vw, 1.02rem);
  --t-body: clamp(1.0625rem, 1rem + 0.28vw, 1.22rem);
  --t-lead: clamp(1.25rem, 1.1rem + 0.65vw, 1.6rem);
  --t-h3: clamp(1.45rem, 1.3rem + 0.7vw, 1.95rem);
  --t-h2: clamp(2.2rem, 1.75rem + 2.2vw, 3.6rem);
  --t-h1: clamp(3.4rem, 2.1rem + 6.4vw, 7.6rem);

  /* Espacement et mise en page */
  --gutter: clamp(1rem, 0.6rem + 2.4vw, 2.5rem);
  --section: clamp(2.25rem, 1.7rem + 2.2vw, 4rem);
  --wrap: 76rem;
  --shadow-deep: 0 1.2rem 2.4rem -0.9rem rgb(0 0 0 / 0.7);
  --rule-brass: rgb(212 162 76 / 0.32);

  /* Grain (bruit fractal) posé sur le bois et le parchemin */
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.5'/%3E%3C/svg%3E");
  /* Filet de laiton avec losange, à gauche (titres) et centré (fins de page, comme les écrans de fin du jeu) */
  --rule-left: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 260 12' preserveAspectRatio='none'%3E%3Cdefs%3E%3ClinearGradient id='g'%3E%3Cstop offset='0' stop-color='%23d4a24c'/%3E%3Cstop offset='1' stop-color='%23d4a24c' stop-opacity='0'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cpath d='M6 0 12 6 6 12 0 6Z' fill='%23f1cf85'/%3E%3Crect x='15' y='5.4' width='245' height='1.2' fill='url(%23g)'/%3E%3C/svg%3E");
  --rule-center: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 520 12' preserveAspectRatio='none'%3E%3Cdefs%3E%3ClinearGradient id='g'%3E%3Cstop offset='0' stop-color='%23d4a24c' stop-opacity='0'/%3E%3Cstop offset='.5' stop-color='%23f1cf85'/%3E%3Cstop offset='1' stop-color='%23d4a24c' stop-opacity='0'/%3E%3C/linearGradient%3E%3C/defs%3E%3Crect y='5.4' width='520' height='1.2' fill='url(%23g)'/%3E%3Cpath d='M260 0 266 6 260 12 254 6Z' fill='%23f1cf85'/%3E%3C/svg%3E");
}

/* ---------- Base ---------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 1rem;
}

/* L'en-tête reste collé en haut dès 48rem : les ancres doivent s'arrêter dessous. */
@media (min-width: 48rem) {
  html {
    scroll-padding-top: 5.5rem;
  }
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background: var(--nuit);
  color: var(--ivoire);
  font-family: var(--f-text);
  font-size: var(--t-body);
  line-height: 1.62;
  font-kerning: normal;
  font-variant-ligatures: common-ligatures;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

main {
  flex: 1;
}

main:focus {
  outline: none;
}

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

h1,
h2,
h3 {
  font-weight: 400;
  text-wrap: balance;
}

p,
li {
  text-wrap: pretty;
}

a {
  color: var(--laiton-clair);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: 3px solid var(--laiton-clair);
  outline-offset: 3px;
}

::selection {
  background: var(--laiton);
  color: var(--encre);
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip {
  position: absolute;
  left: var(--gutter);
  top: -4rem;
  z-index: 11;
  padding: 0.6rem 1rem;
  background: var(--laiton);
  color: var(--encre);
  font-weight: 700;
}

.skip:focus {
  top: 0.5rem;
}

.wrap {
  width: min(100% - 2 * var(--gutter), var(--wrap));
  margin-inline: auto;
}

.wrap--prose {
  --wrap: 48rem;
}

/* ---------- Texte courant ---------- */

.prose {
  max-width: 62ch;
}

.prose p,
.prose ul {
  margin: 0 0 1em;
}

.prose > :last-child {
  margin-bottom: 0;
}

.prose ul {
  padding-left: 1.15em;
}

.prose li + li {
  margin-top: 0.3em;
}

.prose li::marker {
  color: var(--laiton);
}

.prose strong {
  font-weight: 700;
}

.prose--lead {
  font-size: var(--t-lead);
  line-height: 1.5;
  max-width: 50ch;
}

/* Titre de section : Pirata One laiton, filet à losange dessous. */
.heading {
  margin: 0 0 0.45em;
  font-family: var(--f-display);
  font-size: var(--t-h2);
  line-height: 1.02;
  color: var(--laiton);
}

.heading::after {
  content: "";
  display: block;
  width: min(15rem, 70%);
  height: 12px;
  margin-top: 0.28em;
  background: var(--rule-left) left center / 100% 100% no-repeat;
}

/* Titres de page : laiton en relief, comme le titre du menu du jeu. */
.brass {
  background: linear-gradient(180deg, #fbe7b0 0%, #f1cf85 30%, #d4a24c 58%, #a87a32 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0.06em 0 rgb(0 0 0 / 0.55));
  /* Le dégradé ne peint que la boîte du texte : on la dégage pour les accents des capitales. */
  padding-top: 0.16em;
}

/* ---------- Boutons ---------- */

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  margin-top: 2rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3.1rem;
  padding: 0.5rem 1.6rem 0.6rem;
  border-radius: 5px;
  font-family: var(--f-display);
  font-size: 1.4rem;
  line-height: 1.05;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: filter 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}

.btn:active {
  translate: 0 1px;
}

/* Planche de chêne clouée, comme les boutons du menu du jeu. */
.btn--plank {
  padding-inline: 2.3rem;
  color: var(--ivoire);
  text-shadow: 0 1px 0 rgb(0 0 0 / 0.85), 0 0 0.4em rgb(0 0 0 / 0.45);
  border: 2px solid var(--chene-fonce);
  background:
    radial-gradient(circle at 0.95rem 50%, #ecd59a 0 0.12rem, #a9853f 0.17rem, #3d2a12 0.24rem, transparent 0.27rem),
    radial-gradient(circle at calc(100% - 0.95rem) 50%, #ecd59a 0 0.12rem, #a9853f 0.17rem, #3d2a12 0.24rem, transparent 0.27rem),
    repeating-linear-gradient(176deg, rgb(255 225 180 / 0.05) 0 1px, transparent 1px 5px, rgb(0 0 0 / 0.07) 5px 6px, transparent 6px 11px),
    linear-gradient(180deg, #8d5c34 0%, #6a4325 52%, #52321a 100%);
  box-shadow:
    inset 0 1px 0 rgb(255 220 170 / 0.28),
    inset 0 -3px 0 rgb(0 0 0 / 0.28),
    0 0.5rem 1rem -0.35rem rgb(0 0 0 / 0.75);
}

.btn--plank:hover {
  filter: brightness(1.12) saturate(1.05);
  color: #fff8e6;
}

.btn--line {
  color: var(--laiton-clair);
  border: 1px solid rgb(212 162 76 / 0.65);
  background: rgb(10 20 32 / 0.4);
}

.btn--line:hover {
  border-color: var(--laiton-clair);
  background: rgb(212 162 76 / 0.12);
}

/* ---------- En-tête du site : verre fumé sur la nuit, filet de laiton ---------- */

/* Sur mobile, l'en-tête défile avec la page (deux rangées : il prendrait trop de place).
   Dès 48rem, il reste collé en haut, translucide, la page glissant dessous. */
.masthead {
  position: relative;
  z-index: 10;
  padding-top: env(safe-area-inset-top);
  background: rgb(10 20 32 / 0.92);
  box-shadow: 0 0.75rem 1.5rem -1rem rgb(0 0 0 / 0.8);
}

/* Filet de laiton qui s'éteint vers les bords, comme sous les titres des écrans du jeu. */
.masthead::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgb(212 162 76 / 0.55) 20%, var(--laiton-clair) 50%, rgb(212 162 76 / 0.55) 80%, transparent);
}

@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .masthead {
    background: rgb(10 20 32 / 0.72);
    -webkit-backdrop-filter: blur(14px) saturate(150%);
    backdrop-filter: blur(14px) saturate(150%);
  }
}

@media (min-width: 48rem) {
  .masthead {
    position: sticky;
    top: 0;
  }
}

/* Logo à gauche ; menu en dessous sur mobile, à droite dès 48rem. */
.masthead__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0 1.5rem;
  padding-block: 0.35rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 3rem;
  color: var(--laiton);
  text-decoration: none;
}

.brand__mark {
  flex: none;
  width: 1.9rem;
  height: 1.9rem;
  transition: rotate 0.6s cubic-bezier(0.3, 0.7, 0.2, 1);
}

.brand:hover .brand__mark {
  rotate: 45deg;
}

.brand__name {
  font-family: var(--f-display);
  font-size: clamp(1.7rem, 1.45rem + 0.9vw, 2.15rem);
  line-height: 1;
  background: linear-gradient(180deg, #fbe7b0 0%, #f1cf85 35%, #d4a24c 70%, #b5853a 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  padding-top: 0.12em;
}

.brand__logo {
  display: block;
  max-height: 3.25rem;
  width: auto;
}

.nav {
  flex: 1 1 100%;
}

.nav ul {
  display: flex;
  justify-content: space-between;
  gap: 0 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 2.9rem;
  font-family: var(--f-display);
  font-size: clamp(1.15rem, 1.05rem + 0.45vw, 1.4rem);
  line-height: 1;
  color: var(--ivoire);
  text-decoration: none;
  transition: color 0.15s ease;
}

.nav a:hover,
.nav a[aria-current="page"] {
  color: var(--laiton-clair);
}

/* Page en cours : un losange de laiton sous le lien. */
.nav a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0.35rem;
  width: 0.4rem;
  height: 0.4rem;
  margin-left: -0.2rem;
  background: var(--laiton-clair);
  rotate: 45deg;
}

@media (min-width: 48rem) {
  .nav {
    flex: 0 1 auto;
  }

  .nav ul {
    gap: 0 2.25rem;
  }
}

/* ---------- Accueil : en-tête et éventail de cartes ---------- */

.hero {
  position: relative;
  isolation: isolate;
  overflow: clip;
  padding-block: clamp(1.75rem, 1.25rem + 2.5vw, 3.75rem) clamp(2rem, 1.5rem + 2.5vw, 3.75rem);
  background: var(--abysse);
}

.hero__bg,
.page-head__bg {
  position: absolute;
  inset: 0;
  z-index: -1;
}

.hero__bg img,
.page-head__bg img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero__bg::after,
.page-head__bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 60% at 72% 55%, rgb(212 162 76 / 0.16), transparent 70%),
    linear-gradient(180deg, rgb(10 20 32 / 0.72) 0%, rgb(15 29 46 / 0.55) 45%, var(--nuit) 100%);
}

/* Texte puis éventail sur mobile ; côte à côte dès 60rem. */
.hero__inner {
  display: grid;
  gap: clamp(1.5rem, 4vw, 4rem);
  align-items: center;
}

.hero__title {
  margin: 0;
  font-family: var(--f-display);
  font-size: var(--t-h1);
  line-height: 0.92;
  overflow-wrap: anywhere;
}

.hero__lead {
  max-width: 26ch;
  margin: 0.55em 0 0;
  font-size: var(--t-lead);
  font-style: italic;
  line-height: 1.35;
  color: var(--ivoire);
}

.hero__intro {
  margin-top: 1.1rem;
  max-width: 50ch;
  color: var(--ivoire-doux);
}

/* La main : les cartes s'ouvrent en éventail autour d'un pivot sous la main. */
.hand {
  --mid: calc((var(--n) - 1) / 2);
  position: relative;
  width: min(100%, 25rem);
  aspect-ratio: 10 / 7;
  margin-inline: auto;
}

.hand__cards {
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.hand__card {
  --offset: calc(var(--i) - var(--mid));
  position: absolute;
  left: 32%;
  bottom: 0;
  width: 36%;
  z-index: var(--i);
  transform-origin: 50% 165%;
  rotate: calc(var(--offset) * 10deg);
  translate: 0 calc(max(var(--offset), -1 * var(--offset)) * 3%);
  animation: deal 0.75s cubic-bezier(0.2, 0.75, 0.25, 1) backwards;
  animation-delay: calc(0.15s + var(--i) * 0.09s);
}

.hand__card img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 4.5% / 3.2%;
  box-shadow: 0 0 0 1px rgb(0 0 0 / 0.5), 0 1.4rem 2rem -0.8rem rgb(0 0 0 / 0.8);
}

@keyframes deal {
  from {
    rotate: 0deg;
    translate: 0 22%;
    opacity: 0;
  }
}

/* Survol : la carte passe devant les autres et se soulève, entièrement visible. */
@media (hover: hover) {
  .hand__card {
    transition: translate 0.25s ease, scale 0.25s ease;
  }

  .hand__card:hover {
    z-index: 20;
    translate: 0 -9%;
    scale: 1.06;
  }

  .hand__card:hover img {
    box-shadow: 0 0 0 1px rgb(0 0 0 / 0.5), 0 0 0 2px rgb(241 207 133 / 0.55), 0 1.8rem 2.6rem -0.8rem rgb(0 0 0 / 0.9);
  }
}

@media (min-width: 60rem) {
  .hero__inner {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  }

  .hand {
    width: min(100%, 38rem);
    aspect-ratio: 10 / 8;
  }
}

/* ---------- Sections ---------- */

.section {
  padding-block: var(--section);
}

.section--tight {
  padding-top: clamp(1.5rem, 3vw, 2.5rem);
}

.section:not(.section--deep) + .section:not(.section--deep) {
  padding-top: 0;
}

.section--deep {
  background: var(--abysse);
  border-block: 1px solid rgb(212 162 76 / 0.16);
}

/* Cadre d'image : liseré de laiton fin sur fond d'abysse. */
.frame {
  display: block;
  padding: 4px;
  border: 1px solid rgb(212 162 76 / 0.55);
  border-radius: 3px;
  background: rgb(10 20 32 / 0.7);
  box-shadow: var(--shadow-deep);
}

.frame img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

/* Texte et visuel : empilés sur mobile, côte à côte dès 56rem. */
.split {
  display: grid;
  gap: clamp(2rem, 5vw, 5rem);
  align-items: center;
}

@media (min-width: 56rem) {
  .split {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
}

/* ---------- Étapes d'une partie (vraie séquence : numérotées) ---------- */

.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(17rem, 100%), 1fr));
  gap: clamp(1.75rem, 2.5vw, 2.25rem) clamp(1.5rem, 3vw, 2.5rem);
  margin: clamp(1.25rem, 2.5vw, 2rem) 0 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.step {
  counter-increment: step;
}

.step p {
  margin: 0;
  color: var(--ivoire-doux);
}

.step__title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 1.15rem 0 0.4rem;
  font-family: var(--f-display);
  font-size: var(--t-h3);
  line-height: 1.1;
  color: var(--ivoire);
}

/* Numéro frappé dans une pièce de laiton. */
.step__title::before {
  display: grid;
  place-items: center;
  flex: none;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  font-family: var(--f-display);
  font-size: 1.35rem;
  line-height: 1;
  color: var(--encre);
  background: radial-gradient(circle at 35% 30%, #fbe7b0 0%, #d4a24c 55%, #8a6424 100%);
  box-shadow: inset 0 0 0 2px rgb(90 60 20 / 0.55), 0 2px 4px rgb(0 0 0 / 0.5);
}

.step__title::before {
  content: counter(step);
}

/* ---------- Les dés : le bac des dés du combat ---------- */

.dice-tray {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.25rem 0;
  margin: 0;
  padding: clamp(1.25rem, 3vw, 2rem) clamp(0.75rem, 2.5vw, 1.75rem);
  list-style: none;
  border: 2px solid var(--laiton-sombre);
  border-radius: 16px;
  background: linear-gradient(180deg, #14273c 0%, #0d1a2a 100%);
  box-shadow: inset 0 0 0 1px rgb(241 207 133 / 0.14), inset 0 0 2.5rem rgb(0 0 0 / 0.45), var(--shadow-deep);
}

.die {
  flex: 0 0 25%;
  min-width: 0;
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 0.3rem;
  text-align: center;
}

.die img {
  width: clamp(3.4rem, 2.6rem + 3vw, 5rem);
  filter: drop-shadow(0 0.4rem 0.45rem rgb(0 0 0 / 0.55));
}

.die__name {
  font-family: var(--f-display);
  font-size: 1.3rem;
  line-height: 1.1;
  color: var(--ivoire);
}

.die__note {
  margin-top: -0.2rem;
  font-size: var(--t-small);
  font-style: italic;
  line-height: 1.2;
  color: var(--laiton-clair);
}

/* ---------- Modes de jeu ---------- */

.modes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(19rem, 100%), 1fr));
  gap: clamp(1.5rem, 2.5vw, 2.25rem) clamp(1.5rem, 3vw, 2.5rem);
  margin-top: clamp(1rem, 2vw, 1.5rem);
}

.mode__title {
  margin: 0 0 0.45rem;
  font-family: var(--f-display);
  font-size: var(--t-h3);
  line-height: 1.1;
  color: var(--laiton-clair);
}

.mode:not(.mode--featured) {
  padding-top: 1.1rem;
  border-top: 1px solid var(--rule-brass);
  color: var(--ivoire-doux);
}

/* Mode illustré : image et texte côte à côte dès 56rem. */
.mode--featured {
  grid-column: 1 / -1;
  display: grid;
  gap: clamp(1.25rem, 3vw, 3rem);
  align-items: center;
  margin-bottom: 0;
}

.mode--featured .mode__title {
  font-size: calc(var(--t-h2) * 0.82);
  color: var(--ivoire);
}

@media (min-width: 56rem) {
  .mode--featured {
    grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  }
}

/* ---------- Parchemin ---------- */

.parchment {
  color: var(--encre);
  background-color: var(--parchemin);
  background-image:
    var(--grain),
    radial-gradient(ellipse 75% 65% at 50% 42%, rgb(255 250 232 / 0.6), transparent 72%);
  border-radius: 3px;
  box-shadow:
    inset 0 0 0 1px rgb(90 60 30 / 0.25),
    inset 0 0 3.5rem rgb(125 80 35 / 0.38),
    var(--shadow-deep);
}

.parchment a {
  color: var(--chene);
}

/* ---------- Dans la cale : un registre de bord, épinglé sur le tableau d'affichage ---------- */

.ledger {
  position: relative;
  padding: clamp(1.5rem, 4vw, 2.25rem) clamp(1.25rem, 4vw, 2rem) clamp(1.25rem, 3vw, 1.75rem);
}

/* Le clou, comme sur les affiches. */
.ledger--pinned::before {
  content: "";
  position: absolute;
  top: 0.55rem;
  left: 50%;
  width: 0.85rem;
  height: 0.85rem;
  margin-left: -0.425rem;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 32%, #f8e7b4 0%, #c0923f 45%, #4d3412 100%);
  box-shadow: 0 2px 2px rgb(0 0 0 / 0.55);
}

.ledger__title {
  margin: 0;
  font-family: var(--f-display);
  font-size: calc(var(--t-h3) * 1.25);
  line-height: 1;
  text-align: center;
}

.ledger__intro {
  max-width: 34ch;
  margin: 0.45rem auto 1rem;
  font-size: var(--t-small);
  font-style: italic;
  line-height: 1.45;
  text-align: center;
  color: var(--encre-douce);
}

.ledger__intro p {
  margin: 0;
}

.ledger__rows {
  margin: 0;
}

/* Intitulé, points de conduite, valeur. */
.ledger__row {
  display: flex;
  align-items: baseline;
  padding-block: 0.15rem;
}

.ledger__row dt {
  display: flex;
  flex: 1;
  align-items: baseline;
  min-width: 0;
}

.ledger__row dt::after {
  content: "";
  flex: 1;
  min-width: 1.25rem;
  margin: 0 0.6rem;
  border-bottom: 2px dotted rgb(43 27 15 / 0.42);
  translate: 0 -0.3em;
}

.ledger__row dd {
  margin: 0;
  font-family: var(--f-display);
  font-size: clamp(1.4rem, 1.25rem + 0.6vw, 1.8rem);
  line-height: 1;
  color: var(--sang);
}

/* ---------- Galerie ---------- */

/* Mobile : bande à faire défiler du doigt, l'image suivante dépasse.
   Dès 48rem : grille. */
.gallery {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: min(84%, 24rem);
  gap: 1rem;
  margin-top: clamp(1.25rem, 2.5vw, 1.75rem);
  margin-bottom: 0;
  padding: 0 0 1rem;
  list-style: none;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scrollbar-color: var(--laiton-sombre) transparent;
}

.gallery__item {
  min-width: 0;
  scroll-snap-align: start;
}

.gallery figure {
  margin: 0;
}

.gallery__link {
  cursor: zoom-in;
  transition: border-color 0.15s ease;
}

.gallery__link:hover {
  border-color: var(--laiton-clair);
}

.gallery figcaption {
  margin-top: 0.6rem;
  font-size: var(--t-small);
  font-style: italic;
  line-height: 1.4;
  color: var(--ivoire-doux);
}

@media (min-width: 48rem) {
  .gallery {
    grid-auto-flow: row;
    grid-auto-columns: auto;
    grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr));
    gap: 2rem 1.5rem;
    overflow: visible;
    padding-bottom: 0;
  }
}

/* ---------- Fin de page : titre entre deux filets, comme l'écran de victoire ---------- */

.finale {
  padding-block: var(--section);
  text-align: center;
  background:
    radial-gradient(ellipse 55% 65% at 50% 50%, rgb(212 162 76 / 0.15), transparent 72%),
    var(--abysse);
  border-top: 1px solid rgb(212 162 76 / 0.16);
}

.finale__inner {
  display: grid;
  justify-items: center;
  gap: 1rem;
}

.finale__title {
  max-width: 24ch;
  margin: 0;
  padding-block: 0.55em;
  font-family: var(--f-display);
  font-size: var(--t-h2);
  line-height: 1.05;
  color: var(--laiton-clair);
  background:
    var(--rule-center) top center / 100% 12px no-repeat,
    var(--rule-center) bottom center / 100% 12px no-repeat;
}

.finale__text {
  margin-inline: auto;
  color: var(--ivoire-doux);
}

/* ---------- En-tête des pages intérieures ---------- */

.page-head {
  position: relative;
  isolation: isolate;
  overflow: clip;
  padding-block: clamp(2rem, 1.5rem + 2.5vw, 4rem) clamp(1.75rem, 1.4rem + 1.8vw, 3rem);
  background: var(--abysse);
}

.page-head--plain {
  background:
    radial-gradient(ellipse 60% 90% at 15% 0%, rgb(212 162 76 / 0.12), transparent 70%),
    var(--abysse);
  border-bottom: 1px solid rgb(212 162 76 / 0.16);
}

.page-head__title {
  margin: 0;
  font-family: var(--f-display);
  font-size: clamp(2.9rem, 1.9rem + 4.6vw, 6.2rem);
  line-height: 0.95;
}

.page-head__lead {
  max-width: 34ch;
  margin: 0.6em 0 1.1rem;
  font-size: var(--t-lead);
  font-style: italic;
  line-height: 1.35;
}

.page-head .prose {
  margin-top: 1rem;
  color: var(--ivoire-doux);
}

.page-head__lead + .prose {
  margin-top: 0;
}

/* ---------- Recrutement : la carte provisoire tamponnée ---------- */

.specimen {
  position: relative;
  width: min(78%, 19rem);
  margin: 0 auto;
  rotate: -2.5deg;
}

.specimen img {
  display: block;
  width: 100%;
  border-radius: 4.5% / 3.2%;
  box-shadow: 0 0 0 1px rgb(0 0 0 / 0.5), var(--shadow-deep);
}

.stamp {
  position: absolute;
  left: 50%;
  top: 40%;
  translate: -50% -50%;
  rotate: -16deg;
  padding: 0.12em 0.5em 0.18em;
  font-family: var(--f-display);
  font-size: clamp(2rem, 1.6rem + 2vw, 3rem);
  line-height: 1;
  color: #a5281a;
  white-space: nowrap;
  background: rgb(246 236 210 / 0.86);
  border: 4px double currentColor;
  border-radius: 6px;
  box-shadow: 0 0.4rem 1rem rgb(0 0 0 / 0.45);
}

/* ---------- Recrutement : le tableau d'avis de recherche ---------- */

/* Panneau de planches horizontales, sombre, clouté par les affiches. */
.board {
  padding-block: var(--section);
  color: var(--ivoire);
  background-color: #4b2f1a;
  background-image:
    var(--grain),
    repeating-linear-gradient(180deg, rgb(0 0 0 / 0.55) 0 2px, rgb(255 215 160 / 0.07) 2px 3px, transparent 3px 7.5rem),
    repeating-linear-gradient(180deg, transparent 0 7.5rem, rgb(0 0 0 / 0.12) 7.5rem 15rem),
    repeating-linear-gradient(181deg, rgb(255 230 190 / 0.03) 0 1px, transparent 1px 6px, rgb(0 0 0 / 0.06) 6px 7px, transparent 7px 13px),
    linear-gradient(90deg, #4f311b 0%, #5d3a20 35%, #4a2d18 65%, #573720 100%);
  border-block: 4px solid var(--chene-fonce);
  box-shadow: inset 0 1.5rem 2rem -1.25rem rgb(0 0 0 / 0.7), inset 0 -1.5rem 2rem -1.25rem rgb(0 0 0 / 0.7);
}

.board__head .prose {
  color: var(--ivoire);
}

.board__head--with-ledger {
  display: grid;
  gap: clamp(1.5rem, 3vw, 2.5rem);
  align-items: start;
}

@media (min-width: 56rem) {
  .board__head--with-ledger {
    grid-template-columns: minmax(0, 1fr) minmax(0, 26rem);
  }

  .ledger--pinned {
    rotate: 1deg;
  }
}

.heading--on-wood {
  color: var(--laiton-clair);
  text-shadow: 0 2px 0 rgb(0 0 0 / 0.6);
}

.posters {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(17.5rem, 100%), 1fr));
  gap: clamp(1.75rem, 3vw, 2.25rem) clamp(1.5rem, 3vw, 2.5rem);
  margin: clamp(1.5rem, 3vw, 2.25rem) 0 0;
  padding: 0;
  list-style: none;
}

.poster {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.6rem clamp(1rem, 4vw, 1.4rem) 1.4rem;
  text-align: center;
  color: var(--encre);
  background-color: var(--parchemin);
  background-image:
    var(--grain),
    radial-gradient(ellipse 80% 70% at 50% 40%, rgb(255 248 228 / 0.55), transparent 75%);
  box-shadow:
    inset 0 0 0 1px rgb(90 60 30 / 0.3),
    inset 0 0 2.75rem rgb(110 70 30 / 0.42),
    0 1rem 1.4rem -0.5rem rgb(0 0 0 / 0.7);
}

/* Le clou qui tient l'affiche. */
.poster::before {
  content: "";
  position: absolute;
  top: 0.55rem;
  left: 50%;
  width: 0.85rem;
  height: 0.85rem;
  margin-left: -0.425rem;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 32%, #f8e7b4 0%, #c0923f 45%, #4d3412 100%);
  box-shadow: 0 2px 2px rgb(0 0 0 / 0.55);
}

/* Affiches légèrement de travers dès qu'il y en a plusieurs par rangée. */
@media (min-width: 40rem) {
  .poster:nth-child(3n + 1) {
    rotate: -1.1deg;
  }

  .poster:nth-child(3n + 2) {
    rotate: 0.9deg;
    margin-top: 0.75rem;
  }

  .poster:nth-child(3n) {
    rotate: -0.4deg;
  }
}

.poster__banner {
  margin: 0.45rem 0 0.7rem;
  font-family: var(--f-display);
  font-size: clamp(2.3rem, 1.9rem + 1.4vw, 3rem);
  line-height: 0.95;
}

.poster__photo {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border: 3px solid var(--encre);
  background: #d6c08f;
  box-shadow: inset 0 0 1.5rem rgb(60 35 15 / 0.55);
}

.poster__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 28%;
  filter: sepia(0.3) contrast(1.05);
}

.poster__unknown {
  font-family: var(--f-display);
  font-size: 9rem;
  line-height: 1;
  color: rgb(43 27 15 / 0.3);
}

.poster__title {
  margin: 0.95rem 0 0.45rem;
  font-family: var(--f-display);
  font-size: clamp(1.55rem, 1.35rem + 0.7vw, 1.95rem);
  line-height: 1.05;
}

.poster__text {
  margin: 0 0 1.1rem;
  font-size: var(--t-small);
  line-height: 1.5;
  color: var(--encre-douce);
}

/* La ligne de la prime : ici, le volume de travail. */
.poster__bounty {
  width: 100%;
  margin: auto 0 0;
  padding: 0.3rem 0.5rem 0.4rem;
  font-family: var(--f-display);
  font-size: 1.65rem;
  line-height: 1.1;
  color: var(--sang);
  border-block: 2px solid rgb(43 27 15 / 0.55);
}

.poster__format {
  margin: 0.5rem 0 1.1rem;
  font-size: var(--t-small);
  font-style: italic;
  line-height: 1.35;
  color: var(--encre-douce);
}

.poster__bounty + .poster__apply {
  margin-top: 1.1rem;
}

.poster__apply {
  display: inline-flex;
  align-items: center;
  min-height: 2.9rem;
  padding: 0.35rem 1.5rem 0.45rem;
  font-family: var(--f-display);
  font-size: 1.35rem;
  line-height: 1;
  color: var(--parchemin-clair);
  text-decoration: none;
  background: var(--encre);
  border-radius: 4px;
  transition: background-color 0.15s ease;
}

.poster__apply:hover {
  background: #573620;
}

.poster__apply:focus-visible {
  outline-color: var(--encre);
}

/* ---------- Contact ---------- */

/* Formulaire puis encadré sur mobile ; côte à côte dès 60rem. */
.contact {
  display: grid;
  gap: clamp(2.5rem, 5vw, 4rem);
  align-items: start;
}

@media (min-width: 60rem) {
  .contact {
    grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr);
  }
}

.letter {
  container-type: inline-size;
  padding: clamp(1.4rem, 4vw, 3rem);
}

.letter__title {
  margin: 0 0 0.5rem;
  font-family: var(--f-display);
  font-size: var(--t-h2);
  line-height: 1;
}

.form {
  display: grid;
  gap: 1.4rem;
}

.form__row {
  display: grid;
  gap: 1.4rem;
}

@container (min-width: 32rem) {
  .form__row {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
}

.form .btn {
  justify-self: start;
}

.field {
  display: grid;
  gap: 0.35rem;
  min-width: 0;
}

.field > label {
  font-weight: 650;
  line-height: 1.3;
}

.field__help {
  margin: -0.15rem 0 0.1rem;
  font-size: var(--t-small);
  line-height: 1.4;
  color: var(--encre-douce);
}

.field__error {
  margin: 0;
  font-size: var(--t-small);
  font-weight: 650;
  line-height: 1.4;
  color: var(--sang);
}

.form input[type="text"],
.form input[type="email"],
.form input[type="url"],
.form select,
.form textarea {
  width: 100%;
  min-height: 3rem;
  padding: 0.6rem 0.8rem;
  font: inherit;
  font-size: max(16px, 1rem);
  line-height: 1.4;
  color: var(--encre);
  background: rgb(255 251 240 / 0.78);
  border: 1.5px solid rgb(43 27 15 / 0.45);
  border-radius: 3px;
}

.form textarea {
  min-height: 11rem;
  resize: vertical;
  line-height: 1.55;
}

.form select {
  appearance: none;
  padding-right: 2.5rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%232b1b0f' stroke-width='1.6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.9rem center;
  background-size: 0.8rem;
}

.form input::placeholder {
  color: rgb(90 68 48 / 0.6);
}

.form :is(input, select, textarea):focus-visible {
  outline: 3px solid var(--chene);
  outline-offset: 1px;
  border-color: var(--encre);
}

.form [aria-invalid="true"] {
  border-color: var(--sang);
  box-shadow: 0 0 0 1px var(--sang);
}

.field--check {
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: 0.75rem;
  align-items: start;
}

.field--check input {
  width: 1.35rem;
  height: 1.35rem;
  margin: 0.2rem 0 0;
  accent-color: var(--chene);
}

.field--check label {
  font-weight: 400;
}

.field--check .field__error {
  grid-column: 2;
}

.form__summary {
  padding: 1rem 1.25rem;
  border: 2px solid var(--sang);
  border-radius: 3px;
  background: rgb(158 44 29 / 0.08);
}

.form__summary:focus-visible {
  outline-color: var(--sang);
}

.form__summary p {
  margin: 0;
  font-weight: 650;
}

.form__summary ul {
  margin: 0.5rem 0 0;
  padding-left: 1.2rem;
}

.form__summary a {
  color: var(--sang);
}

/* Piège à robots : invisible pour les personnes, rempli par les robots. */
.trap {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.link-ink {
  font-weight: 650;
  color: var(--encre);
}

.contact__aside {
  display: grid;
  gap: 1.75rem;
}

.aside-block + .aside-block {
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule-brass);
}

.aside-block__title {
  margin: 0 0 0.5rem;
  font-family: var(--f-display);
  font-size: var(--t-h3);
  line-height: 1.1;
  color: var(--laiton);
}

.aside-block--quiet {
  font-size: var(--t-small);
  color: var(--ivoire-doux);
}

.channels {
  display: grid;
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.channels li {
  display: grid;
}

.channels__label {
  font-size: var(--t-small);
  font-style: italic;
  color: var(--ivoire-doux);
}

/* ---------- Pied de page ---------- */

.footer {
  padding-block: clamp(1.75rem, 3vw, 2.5rem) calc(clamp(1.5rem, 3vw, 2rem) + env(safe-area-inset-bottom));
  font-size: var(--t-small);
  color: var(--ivoire-doux);
  background: var(--abysse);
  border-top: 1px solid rgb(212 162 76 / 0.22);
}

.page-home .footer {
  border-top-color: rgb(212 162 76 / 0.1);
}

.footer__inner {
  display: grid;
  gap: 1.5rem 3rem;
}

.footer__name {
  margin: 0 0 0.5rem;
  font-family: var(--f-display);
  font-size: 1.9rem;
  line-height: 1;
  color: var(--laiton);
}

.footer__note p {
  max-width: 62ch;
  margin: 0;
}

.footer__nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer__nav a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  color: var(--ivoire);
  text-decoration: none;
}

.footer__nav a:hover {
  color: var(--laiton-clair);
  text-decoration: underline;
}

@media (min-width: 48rem) {
  .footer__inner {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
  }

  .footer__nav ul {
    flex-direction: column;
    align-items: flex-end;
  }
}

/* ---------- Visionneuse d'images ---------- */

.lightbox {
  width: 100%;
  max-width: 100%;
  height: 100%;
  max-height: 100%;
  margin: 0;
  padding: 0;
  color: var(--ivoire);
  background: transparent;
  border: 0;
}

.lightbox::backdrop {
  background: rgb(4 9 16 / 0.93);
}

.lightbox[open] {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
}

.lightbox__figure {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  place-items: center;
  gap: 0.75rem;
  min-height: 0;
  margin: 0;
  padding: max(1rem, env(safe-area-inset-top)) var(--gutter) 0;
}

.lightbox__img {
  max-width: 100%;
  max-height: calc(100vh - 9rem);
  max-height: calc(100dvh - 9rem);
  width: auto;
  height: auto;
  object-fit: contain;
  box-shadow: 0 1rem 3rem rgb(0 0 0 / 0.6);
}

.lightbox__caption {
  font-style: italic;
  text-align: center;
  color: var(--ivoire-doux);
}

.lightbox__bar {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 0.9rem var(--gutter) max(0.9rem, env(safe-area-inset-bottom));
}

.lightbox__btn {
  min-height: 2.9rem;
  padding: 0.35rem 1.1rem 0.45rem;
  font-family: var(--f-display);
  font-size: 1.25rem;
  color: var(--ivoire);
  background: rgb(255 255 255 / 0.05);
  border: 1px solid rgb(212 162 76 / 0.55);
  border-radius: 4px;
  cursor: pointer;
}

.lightbox__btn:hover {
  border-color: var(--laiton-clair);
  background: rgb(212 162 76 / 0.12);
}

/* ---------- Mouvement réduit ---------- */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0s !important;
    transition-duration: 0.01ms !important;
  }
}
