/* Spy Challenge - spy.mysteryprod.fr
   Reprise HTML/CSS de la maquette originale (index.jpg, 800x1505).
   Ecrit en mobile first : le socle vise le telephone, les media queries
   (min-width) ajoutent la mise en page des grands ecrans. */

@font-face {
  font-family: 'Courier Prime';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/courier-prime-400.woff2') format('woff2');
}
@font-face {
  font-family: 'Courier Prime';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/courier-prime-700.woff2') format('woff2');
}
@font-face {
  font-family: 'Caveat';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/caveat-600.woff2') format('woff2');
}

:root {
  --ink: #111010;
  --band: #1c1c1c;
  --blue: #2415cf;
  --postit: #fffda4;
  --paper-warm: #dedcd0;
  --paper-cool: #c2c5cc;
  --sheet-max: 860px;
  --mono: 'Courier Prime', 'Courier New', Courier, monospace;
  --hand: 'Caveat', 'Segoe Script', 'Bradley Hand', 'Comic Sans MS', cursive;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: #8d9095;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 16px;
  line-height: 1.6;
}

img { max-width: 100%; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--band);
  color: #fff;
  padding: .6em 1em;
  z-index: 50;
}
.skip-link:focus { left: 0; }

/* ---------- feuille de papier ---------- */

.sheet {
  max-width: var(--sheet-max);
  margin: 0 auto;
  min-height: 100vh;
  overflow: hidden;
  box-shadow: 0 0 40px rgba(0, 0, 0, .45);
  background-color: var(--paper-cool);
  background-image:
    repeating-linear-gradient(45deg, rgba(255,255,255,.30) 0 1px, transparent 1px 19px),
    repeating-linear-gradient(-45deg, rgba(255,255,255,.22) 0 1px, transparent 1px 27px),
    repeating-linear-gradient(45deg, rgba(90,95,90,.10) 0 1px, transparent 1px 61px),
    repeating-linear-gradient(-45deg, rgba(90,95,90,.08) 0 1px, transparent 1px 83px),
    radial-gradient(ellipse 90% 55% at 50% 30%, #f0f1ec 0%, var(--paper-warm) 45%, var(--paper-cool) 100%);
}

/* ---------- en-tete : post-it + logo ---------- */

.masthead {
  display: grid;
  justify-items: center;
  gap: 18px;
  padding: 20px 16px 16px;
}

.postit {
  position: relative;
  width: min(300px, 100%);
  background: var(--postit);
  background-image: linear-gradient(160deg, #fffeb8 0%, var(--postit) 45%, #f2eb8a 100%);
  padding: 26px 16px 18px;
  transform: rotate(-1.6deg);
  box-shadow: 3px 5px 10px rgba(0, 0, 0, .32);
  min-height: 170px;
  display: flex;
  align-items: center;
}

.postit p {
  margin: 0;
  width: 100%;
  font-family: var(--hand);
  font-weight: 600;
  font-size: 1.42rem;
  line-height: 1.22;
  text-align: center;
  color: #1a1a2e;
  transform: rotate(1deg);
}

.postit__clip {
  position: absolute;
  top: -16px;
  left: 34px;
  width: 26px;
  height: 58px;
  filter: drop-shadow(1px 2px 1px rgba(0, 0, 0, .35));
}

.logo { margin: 0; text-align: center; }
.logo img {
  width: 280px;
  max-width: 100%;
  height: auto;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, .3));
}

/* ---------- bandeau noir + choix de langue ---------- */

.band {
  position: relative;
  background: var(--band);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  min-height: 60px;
  padding-right: 100px; /* place laissee a l'enveloppe */
}

.langswitch {
  display: flex;
  gap: 6px;
  flex: none;
}

.lang {
  width: 40px;
  height: 40px;
  padding: 4px;
  border: 0;
  border-radius: 50%;
  background: none;
  cursor: pointer;
  line-height: 0;
  opacity: .5;
  transition: opacity .18s ease, transform .18s ease, box-shadow .18s ease;
}
.lang:hover { opacity: .9; }
.lang.is-active {
  opacity: 1;
  transform: scale(1.06);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, .75);
}
.lang:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}
.flag { width: 100%; height: auto; display: block; }

.band__title {
  margin: 0;
  font-size: .85rem;
  line-height: 1.35;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--blue);
  text-shadow: 0 0 12px rgba(60, 40, 255, .75);
}

.band__envelope {
  position: absolute;
  right: 4px;
  bottom: -14px;
  width: 88px;
  height: auto;
  pointer-events: none;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, .35));
}

/* ---------- corps du briefing ---------- */

.briefing { padding: 26px 18px 6px; }

.briefing p { margin: 0 0 1.35em; }
.briefing strong { font-weight: 700; }

blockquote {
  margin: 0 0 1.35em;
  padding: .1em 0 .1em 1em;
  border-left: 3px solid rgba(0, 0, 0, .55);
}
blockquote::before { content: '\201C'; }
blockquote::after  { content: '\201D'; }

.clues {
  list-style: none;
  margin: 0;
  padding: 0;
  width: 100%;
}
.clues li { position: relative; padding-left: 1.3em; }
.clues li::before {
  content: '\2731';
  position: absolute;
  left: 0;
  top: .05em;
}

/* les trois plantes du jardin botanique : note manuscrite collee dans le briefing */
.postit--clues {
  width: min(320px, 100%);
  min-height: 0;
  margin: -0.4em 0 2em;
  padding: 24px 20px 20px;
  transform: rotate(1.4deg);
  background-image: linear-gradient(160deg, #fffef0 0%, #fdf6a9 45%, #f4ec8c 100%);
}

/* bout de scotch */
.postit--clues::before {
  content: '';
  position: absolute;
  top: -11px;
  left: 50%;
  width: 88px;
  height: 22px;
  transform: translateX(-50%) rotate(-2.5deg);
  background: rgba(255, 255, 255, .5);
  border-left: 1px dashed rgba(0, 0, 0, .1);
  border-right: 1px dashed rgba(0, 0, 0, .1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .18);
}

.postit--clues .clues {
  font-family: var(--hand);
  font-weight: 600;
  font-size: 1.34rem;
  line-height: 1.4;
  color: #1a1a2e;
  transform: rotate(-.6deg);
}
.postit--clues .clues li::before {
  top: .16em;
  font-size: .78em;
  color: rgba(26, 26, 46, .8);
}

/* ---------- pieces jointes video ---------- */

.clip {
  margin: 0 0 1.6em;
  padding: 8px 8px 2px;
  background: var(--band);
  box-shadow: 0 6px 14px rgba(0, 0, 0, .35);
}

.clip video {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  background: #000;
}

.clip figcaption {
  padding: 9px 4px 8px;
  font-size: .74rem;
  letter-spacing: .07em;
  line-height: 1.4;
  text-transform: uppercase;
  text-align: center;
  color: rgba(255, 255, 255, .74);
}

.clip figcaption::before {
  content: '';
  display: inline-block;
  width: .55em;
  height: .55em;
  margin-right: .6em;
  border-radius: 50%;
  background: #e2213a;
  box-shadow: 0 0 6px rgba(226, 33, 58, .9);
  vertical-align: baseline;
}

/* ---------- emergency box + image a montrer ---------- */

.emergency {
  display: grid;
  gap: 18px;
  margin: 26px 0 10px;
}

.emergency__text {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
}

.emergency__text h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.5;
}

.emergency__arrow { display: none; }

.emergency__box {
  width: 120px;
  height: auto;
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .3));
}

.picture {
  display: block;
  width: 100%;
  position: relative;
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
  line-height: 0;
  transition: transform .18s ease;
}
.picture:hover { transform: scale(1.02); }
.picture:focus-visible { outline: 3px solid var(--blue); outline-offset: 4px; }
.picture img {
  width: 100%;
  height: auto;
  box-shadow: 0 6px 14px rgba(0, 0, 0, .35);
}

.picture__hint {
  display: block;
  line-height: 1.4;
  font-size: .78rem;
  letter-spacing: .05em;
  text-transform: uppercase;
  text-align: center;
  padding-top: 8px;
  color: rgba(0, 0, 0, .62);
}

/* ---------- pied ---------- */

.footer {
  padding: 22px 18px 26px;
  text-align: center;
  font-size: .85rem;
  color: rgba(0, 0, 0, .68);
}
.footer a { color: inherit; }

/* ---------- visionneuse plein ecran ---------- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4vmin;
  background: rgba(8, 8, 10, .94);
  cursor: zoom-out;
}
.lightbox[hidden] { display: none; }

.lightbox__img {
  max-width: 100%;
  max-height: 92vh;
  width: auto;
  height: auto;
  box-shadow: 0 10px 40px rgba(0, 0, 0, .8);
}

.lightbox__close {
  position: absolute;
  top: 10px;
  right: 14px;
  width: 46px;
  height: 46px;
  font: 700 2rem/1 var(--mono);
  color: #fff;
  background: rgba(255, 255, 255, .12);
  border: 0;
  border-radius: 50%;
  cursor: pointer;
}
.lightbox__close:hover { background: rgba(255, 255, 255, .24); }

/* ---------- apparition au defilement ---------- */

body.js-reveal .reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .5s ease, transform .5s ease;
}
body.js-reveal .reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* ---------- ecrans moyens et grands ---------- */

@media (min-width: 720px) {
  body { font-size: 17px; }

  .masthead {
    grid-template-columns: minmax(0, 260px) 1fr;
    align-items: center;
    justify-items: stretch;
    gap: 10px;
    padding: 14px 18px 18px;
  }
  .postit { min-height: 190px; }
  .logo img { width: 338px; }

  .band {
    gap: 16px;
    padding: 10px 18px;
    padding-right: 190px;
    min-height: 68px;
  }
  .band__title { font-size: 1.28rem; letter-spacing: .16em; }
  .band__envelope { width: 172px; right: 8px; bottom: -20px; }

  .briefing { padding: 34px 26px 10px; }
  .postit--clues { margin-left: 1.4em; }

  .emergency {
    grid-template-columns: 1fr minmax(0, 400px);
    gap: 20px;
    align-items: start;
  }
  .emergency__text {
    display: block;
  }
  .emergency__text h3 { margin-bottom: 1em; font-size: 1.05rem; }
  .emergency__arrow {
    display: inline;
    letter-spacing: -.12em;
    white-space: nowrap;
  }
  .emergency__box {
    display: block;
    width: 190px;
    margin-left: 8px;
  }
}

/* ---------- confort et impression ---------- */

@media (prefers-reduced-motion: reduce) {
  body.js-reveal .reveal { opacity: 1; transform: none; transition: none; }
  .picture:hover, .lang.is-active { transform: none; }
}

@media print {
  body { background: #fff; font-size: 12pt; }
  .sheet { box-shadow: none; background: #fff; max-width: none; }
  .band {
    background: #000 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .picture__hint, .skip-link, .lightbox, .langswitch { display: none !important; }
  body.js-reveal .reveal { opacity: 1; transform: none; }
}
