:root {
  --ink: #302b2c;
  --ink-soft: #40393b;
  --paper: #f4f0e9;
  --paper-deep: #e9e1d9;
  --taupe: #a99a91;
  --taupe-dark: #75665f;
  --violet: #b9a2c6;
  --violet-deep: #80658f;
  --cyan: #9fc9ca;
  --cyan-deep: #527f82;
  --gold: #c8ad75;
  --white: #fffaf4;
  --line: rgba(48,43,44,.18);
  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: "Lato", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--sans);
}

a {
  color: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  height: 58px;
  padding: 0 7.8%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(48,43,44,.97);
  color: var(--violet);
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.brand {
  font-family: var(--serif);
  font-size: 21px;
  letter-spacing: .2em;
  text-decoration: none;
}

nav {
  display: flex;
  gap: clamp(16px,3vw,42px);
}

nav a {
  font-size: 12px;
  letter-spacing: .08em;
  text-decoration: none;
  color: #d4c3db;
}

nav a:hover,
nav a:focus {
  color: var(--cyan);
}

.hero {
  min-height: 450px;
  padding: 76px 7.8% 70px;
  color: var(--white);
  background: linear-gradient(112deg, #494342 0%, #667f80 100%);
  display: flex;
  align-items: flex-start;
}

.hero-inner {
  max-width: 760px;
}

.eyebrow {
  margin: 0 0 22px;
  color: var(--violet-deep);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .2em;
  text-transform: uppercase;
}

.hero .eyebrow {
  color: #d9a6b3;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin: 0 0 28px;
  font: 500 clamp(70px,9vw,108px)/.9 var(--serif);
  letter-spacing: -.035em;
}

.hero-intro {
  max-width: 520px;
  margin-bottom: 24px;
  font-size: 16px;
  line-height: 1.8;
}

.button {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 13px 18px;
  background: var(--cyan-deep);
  color: white;
  border: 1px solid transparent;
  font: 700 13px var(--sans);
  text-decoration: none;
  cursor: pointer;
  transition: .2s ease;
}

.button:hover {
  background: var(--violet-deep);
  transform: translateY(-1px);
}

.section {
  padding: 88px 7.8%;
}

.section-inner {
  max-width: 1240px;
  margin: 0 auto;
}

.section h2 {
  margin: 0 0 28px;
  font: 500 clamp(42px,5vw,58px)/1.05 var(--serif);
}

.intro-copy {
  max-width: 690px;
  font-size: 14px;
  line-height: 1.9;
}

.intro-copy p {
  margin-bottom: 12px;
}

.project {
  background: var(--paper-deep);
}

.project-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 30px;
  margin-bottom: 35px;
}

.project-head p {
  max-width: 480px;
  margin-bottom: 6px;
  font-size: 14px;
  line-height: 1.8;
}

/* GALERIE */

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  gap: 22px;
}

.fragment-card {
  background: var(--paper);
  border: 1px solid var(--line);
  min-width: 0;
}

.image-button {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: #d8d0ca;
  cursor: zoom-in;
  overflow: hidden;
  aspect-ratio: 4/3;
}

.image-button img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: transform .35s ease;
}

.image-button:hover img {
  transform: scale(1.035);
}

.image-placeholder {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: #74696a;
  font: italic 23px var(--serif);
  background: linear-gradient(135deg,#d9d0ca,#b7c9c5);
}

.card-copy {
  padding: 19px 20px 21px;
}

.day {
  margin-bottom: 6px;
  color: var(--violet-deep);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.card-copy h3 {
  margin: 0 0 9px;
  font: 600 27px/1 var(--serif);
}

.card-copy p {
  margin: 0 0 12px;
  font-size: 13px;
  line-height: 1.7;
  white-space: pre-line;
}

.speedpaint {
  display: inline-block;
  margin-top: 3px;
  color: var(--cyan-deep);
  font-size: 12px;
  font-weight: 700;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

/* JEU */

.game {
  color: var(--white);
  background: var(--ink);
}

.game .section-inner {
  max-width: 1450px;
}

.game h2 {
  color: var(--white);
}

.game-lead {
  margin: -10px 0 25px;
  color: #e6ddda;
  font-size: 14px;
  line-height: 1.8;
}

.instructions {
  max-width: 760px;
  margin: 0 0 28px;
  padding: 17px 20px;
  border-left: 2px solid var(--gold);
  background: var(--ink-soft);
  color: #eee8e2;
  font-size: 13px;
  line-height: 1.8;
}

.instructions strong {
  display: block;
  margin-bottom: 9px;
  color: var(--cyan);
}

.instructions p {
  margin: 0 0 7px;
}

.instructions p:last-child {
  margin-bottom: 0;
}

.game-tools {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 22px;
}

.game-tools .button {
  background: var(--violet-deep);
}

.game-tools .button.secondary {
  background: transparent;
  border-color: #817875;
  color: #f8f1e9;
}

.game-status {
  color: #d9cfca;
  font-size: 13px;
  line-height: 1.6;
}

/* GRILLE DES EMPLACEMENTS FIXES */

.word-list {
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  gap: 12px;
  align-items: stretch;
}

/* CHAQUE EMPLACEMENT GARDE SON NUMERO */

.game-slot {
  display: flex;
  align-items: stretch;
  gap: 10px;
  min-width: 0;
  min-height: 76px;
  padding: 9px;
  border: 1px solid rgba(185, 162, 198, 0.35);
  border-radius: 7px;
  background: rgba(255, 250, 244, 0.04);
  transition: border-color .2s ease, background .2s ease;
}

.game-slot.drag-over {
  border-color: var(--cyan);
  background: rgba(159, 201, 202, 0.12);
}

/* NUMERO DORE FIXE */

.slot-number {
  display: flex;
  flex: 0 0 38px;
  align-items: center;
  justify-content: center;
  min-height: 54px;
  border-radius: 5px;
  background: var(--gold);
  color: var(--ink);
  font: 700 15px var(--sans);
}

/* CARTE DE THEME DEPLACABLE */

.word-card {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 54px;
  margin: 0;
  padding: 10px;
  border: 1px solid rgba(185, 162, 198, 0.55);
  border-radius: 5px;
  background: var(--ink-soft);
  color: var(--white);
  font: 600 19px/1.2 var(--serif);
  text-align: center;
  overflow-wrap: anywhere;
  cursor: grab;
  user-select: none;
  touch-action: manipulation;
  transition:
    background .2s ease,
    border-color .2s ease,
    transform .2s ease,
    opacity .2s ease;
}

.word-card:hover {
  border-color: var(--violet);
  background: #51474b;
}

.word-card:active {
  cursor: grabbing;
}

.word-card.dragging {
  opacity: .45;
}

.word-card.selected {
  border: 2px solid var(--cyan);
  background: #51474b;
  transform: scale(1.025);
}

.word-card:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}

/* PIED DE PAGE */

.footer {
  padding: 28px 7.8%;
  background: #292526;
  color: #c8bdba;
  text-align: center;
  font-size: 11px;
  letter-spacing: .08em;
}

/* LIGHTBOX */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: none;
  place-items: center;
  padding: 30px;
  background: rgba(25,22,23,.92);
}

.lightbox.open {
  display: grid;
}

.lightbox img {
  display: block;
  max-width: min(94vw,1400px);
  max-height: 88vh;
  object-fit: contain;
  box-shadow: 0 18px 70px #0008;
}

.lightbox button {
  position: absolute;
  top: 18px;
  right: 25px;
  border: 0;
  background: transparent;
  color: white;
  font-size: 36px;
  cursor: pointer;
}

/* TABLETTES */

@media (max-width: 850px) {
  .gallery-grid {
    grid-template-columns: repeat(2,minmax(0,1fr));
  }

  .word-list {
    grid-template-columns: repeat(2,minmax(0,1fr));
  }

  .project-head {
    display: block;
  }
}

/* TELEPHONES */

@media (max-width: 560px) {
  .topbar {
    height: auto;
    min-height: 58px;
    padding: 12px 5%;
    align-items: flex-start;
    gap: 12px;
    flex-direction: column;
  }

  nav {
    width: 100%;
    justify-content: space-between;
  }

  .hero,
  .section {
    padding-left: 6%;
    padding-right: 6%;
  }

  .hero {
    min-height: 390px;
    padding-top: 65px;
  }

  .gallery-grid,
  .word-list {
    grid-template-columns: 1fr;
  }

  .game-slot {
    min-height: 68px;
  }

  .word-card {
    min-height: 54px;
    font-size: 18px;
  }

  .section {
    padding-top: 65px;
    padding-bottom: 65px;
  }

  .lightbox {
    padding: 12px;
  }
}
