:root {
  --ink: #211a15;
  --paper: #f4ead8;
  --paper-2: #e9dcc6;
  --gold: #c8a467;
  --gold-light: #e7cf9c;
  --red: #853d38;
  --olive: #5d6144;
  --night: #171511;
  --white: #fffaf1;
  --shadow: 0 28px 80px rgba(14, 10, 7, .32);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--night);
  color: var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
.skip-link { position: fixed; left: 1rem; top: -5rem; z-index: 30; background: var(--paper); color: var(--ink); padding: .8rem 1rem; }
.skip-link:focus { top: 1rem; }

.casebar {
  min-height: 78px;
  padding: .65rem clamp(1rem, 4vw, 4rem);
  display: grid;
  grid-template-columns: auto minmax(180px, 330px) auto;
  align-items: center;
  gap: clamp(.8rem, 3vw, 2rem);
  background: rgba(20, 18, 14, .96);
  border-bottom: 1px solid rgba(200, 164, 103, .28);
  position: relative;
  z-index: 10;
}
.casebar__brand { display: flex; align-items: center; gap: .65rem; color: var(--paper); text-decoration: none; letter-spacing: .08em; text-transform: uppercase; font-size: .78rem; }
.casebar__brand span { display: grid; place-items: center; width: 36px; height: 36px; border: 1px solid var(--gold); border-radius: 50%; font: 1.2rem Georgia, serif; color: var(--gold); }
.progress { display: grid; grid-template-columns: 1fr auto; gap: .35rem .8rem; text-transform: uppercase; font-size: .63rem; letter-spacing: .13em; color: #bfb29e; }
.progress strong { color: var(--gold); }
.progress i { grid-column: 1 / -1; height: 3px; background: #3b332b; overflow: hidden; }
.progress b { display: block; height: 100%; background: linear-gradient(90deg, var(--red), var(--gold)); transition: width .6s ease; }
.clue-toggle { justify-self: end; border: 1px solid rgba(200,164,103,.35); color: var(--paper); background: transparent; padding: .55rem .75rem; cursor: pointer; text-transform: uppercase; letter-spacing: .1em; font-size: .65rem; }
.clue-toggle b { display: inline-grid; place-items: center; min-width: 1.5rem; height: 1.5rem; margin-left: .35rem; border-radius: 50%; color: var(--night); background: var(--gold); }

.cover { min-height: calc(100vh - 78px); position: relative; display: grid; align-items: center; overflow: hidden; }
.cover__art, .cover__shade { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cover__art { object-position: center; }
.cover__shade { background: linear-gradient(90deg, rgba(14,12,9,.98) 0%, rgba(14,12,9,.81) 38%, rgba(14,12,9,.14) 73%), linear-gradient(0deg, rgba(14,12,9,.58), transparent 55%); }
.cover__copy { position: relative; z-index: 2; width: min(760px, 92%); padding: clamp(3rem, 7vw, 7rem); animation: rise .8s both; }
.classification { text-transform: uppercase; letter-spacing: .2em; font-size: .68rem; color: var(--gold); font-weight: 800; }
.stamp { display: inline-block; border: 2px solid rgba(198,91,79,.8); color: #d17a70; padding: .35rem .7rem; transform: rotate(-3deg); text-transform: uppercase; letter-spacing: .14em; font-size: .7rem; font-weight: 900; }
.cover h1, .case-file h1 { font-family: Georgia, "Times New Roman", serif; font-weight: 400; letter-spacing: -.04em; }
.cover h1 { font-size: clamp(3.8rem, 8vw, 8.5rem); line-height: .76; margin: 1.35rem 0; }
.cover h1 em { color: var(--gold); font-weight: 400; }
.subtitle { font: clamp(1.3rem, 2vw, 2rem) Georgia, serif; color: var(--white); margin: 0; }
.brief { max-width: 540px; line-height: 1.7; color: #d5c8b6; }
.notice { margin-top: 1.5rem; color: #bcae9b; font-size: .78rem; max-width: 540px; }
.notice summary { cursor: pointer; }
.notice p { line-height: 1.55; }

.case-layout { min-height: calc(100vh - 78px); display: grid; grid-template-columns: minmax(330px, 43%) 1fr; background: radial-gradient(circle at 75% 10%, rgba(133,61,56,.11), transparent 30%), var(--paper); color: var(--ink); }
.case-art { position: relative; min-height: 660px; overflow: hidden; background: #30291f; border-right: 1px solid #786c5b; }
.case-art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(19,16,12,.78), transparent 50%); pointer-events: none; }
.case-art img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.case-art p { position: absolute; left: clamp(1.25rem, 4vw, 3rem); right: clamp(1.25rem, 4vw, 3rem); bottom: 1.5rem; z-index: 2; margin: 0; color: #e8dcc9; font-size: .7rem; line-height: 1.5; }
.case-number { position: absolute; z-index: 2; right: 1.4rem; top: 1rem; font: clamp(4rem, 9vw, 9rem) Georgia, serif; color: rgba(244,234,216,.14); }
.case-file { align-self: center; padding: clamp(2.5rem, 7vw, 7rem); max-width: 940px; }
.case-file h1 { font-size: clamp(2.8rem, 5.6vw, 5.8rem); line-height: .96; margin: .5rem 0 2rem; text-wrap: balance; }
.case-file .lead { font: clamp(1.1rem, 1.8vw, 1.5rem)/1.55 Georgia, serif; color: #3c3027; }
.case-file > p:not(.classification):not(.lead) { color: #62564b; line-height: 1.75; }
.choices { display: grid; gap: .8rem; margin-top: 2rem; }
.choice { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 52px; padding: .9rem 1.15rem; border: 1px solid rgba(76,57,41,.32); background: rgba(255,255,255,.2); color: inherit; text-decoration: none; text-align: left; cursor: pointer; transition: .2s ease; }
.cover .choice { border-color: rgba(200,164,103,.45); background: rgba(24,19,14,.28); }
.choice:hover, .choice:focus-visible { border-color: var(--gold); transform: translateY(-2px); box-shadow: 0 10px 25px rgba(44,31,22,.1); }
.choice--primary { background: var(--gold) !important; border-color: var(--gold) !important; color: var(--ink); font-weight: 800; }

.mini-scene { margin: 2rem 0; padding: 2rem; border: 1px dashed var(--red); text-align: center; }
.false-stamp span { display: block; color: var(--red); text-transform: uppercase; letter-spacing: .15em; font-weight: 900; transform: rotate(-2deg); }
.false-stamp small { display: block; margin-top: 1rem; color: var(--ink); }
.alarm-box { display: flex; gap: 1rem; align-items: center; padding: 1rem; margin: 2rem 0; color: #fff; background: var(--red); animation: alarm 1.1s steps(2) 2; }
.alarm-box span { display: grid; place-items: center; width: 2rem; height: 2rem; border: 2px solid currentColor; border-radius: 50%; font-weight: 900; }

.puzzle, .toolbox, .code-lock, .quiz, .share-box { margin-top: 2rem; padding: clamp(1rem, 3vw, 1.8rem); border: 1px solid rgba(93,73,54,.22); background: rgba(255,255,255,.34); }
.puzzle__label, .code-lock label { display: block; margin-bottom: 1rem; text-transform: uppercase; letter-spacing: .14em; font-size: .68rem; font-weight: 900; color: var(--olive); }
.word-bank { display: flex; flex-wrap: wrap; gap: .55rem; }
.word-bank button { border: 1px solid #b9a98f; background: var(--paper); padding: .55rem .75rem; color: var(--ink); cursor: pointer; }
.word-bank button:disabled { opacity: .35; }
.sentence { min-height: 78px; margin: 1.25rem 0; padding: 1rem; background: #fffaf0; border-left: 3px solid var(--gold); font: 1.15rem/1.5 Georgia, serif; }
.sentence.is-wrong { border-color: var(--red); }
.sentence.is-correct { border-color: var(--olive); }
.puzzle__actions { display: flex; flex-wrap: wrap; gap: .65rem; }

.toolbox { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: .65rem; }
.toolbox label { display: flex; align-items: center; gap: .7rem; padding: .8rem; background: #fffaf0; border: 1px solid #dfd0b7; cursor: pointer; }
.toolbox input { accent-color: var(--olive); }
.toolbox button, .toolbox p, .toolbox div { grid-column: 1 / -1; }
.toolbox p, .quiz p, .code-lock p, .share-box p { min-height: 1.4rem; color: var(--red); font-weight: 700; }
.toolbox div .choice { width: 100%; }

.code-lock div { display: flex; }
.code-lock input { flex: 1; min-width: 0; padding: .9rem 1rem; border: 1px solid #9a876d; background: #fffaf0; text-transform: uppercase; letter-spacing: .13em; }
.code-lock button { border: 0; padding: .9rem 1rem; background: var(--ink); color: var(--paper); cursor: pointer; }
.quiz { display: grid; gap: .7rem; }
.quiz .choice { width: 100%; }
.quiz .choice.is-wrong { border-color: var(--red); background: rgba(133,61,56,.08); }
.quiz .choice.is-correct { border-color: var(--olive); background: rgba(93,97,68,.12); }

.verdict { position: relative; min-height: 220px; margin-top: 2rem; display: grid; grid-template-columns: 1.4fr .7fr; align-items: center; gap: 1rem; overflow: hidden; }
.verdict__yes, .verdict__no { min-height: 90px; display: grid; place-items: center; border: 0; text-decoration: none; font-weight: 900; letter-spacing: .08em; cursor: pointer; }
.verdict__yes { background: var(--red); color: #fff; font-size: clamp(1.5rem, 4vw, 2.6rem); }
.verdict__no { background: #d8cbb7; color: var(--ink); transition: transform .18s ease; }
.verdict p { position: absolute; bottom: 0; left: 0; color: var(--red); font-weight: 800; }
.final-reveal { margin: 2rem 0; padding: 2rem; display: grid; place-items: center; background: radial-gradient(circle, #a4554d, var(--red)); color: white; box-shadow: var(--shadow); }
.final-reveal span { text-transform: uppercase; letter-spacing: .22em; font-size: .7rem; }
.final-reveal strong { font: clamp(4rem, 10vw, 8rem) Georgia, serif; line-height: 1; }
.final-reveal i { font-size: 2rem; color: var(--gold-light); }
.share-box { display: grid; gap: .75rem; }

.clue-drawer { position: fixed; right: 0; top: 0; bottom: 0; z-index: 20; width: min(390px, 92vw); padding: 1.4rem; background: #211c17; color: var(--paper); box-shadow: -20px 0 60px rgba(0,0,0,.42); overflow: auto; }
.clue-drawer > div { display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid rgba(200,164,103,.25); }
.clue-drawer h2 { font: 1.8rem Georgia, serif; }
.clue-drawer [data-clue-close] { border: 0; color: var(--paper); background: transparent; font-size: 2rem; cursor: pointer; }
.clue-drawer ol { padding-left: 1.4rem; }
.clue-drawer li { padding: .55rem 0; color: #d8cbb8; }
.reset-link { border: 0; background: transparent; color: #b99087; text-decoration: underline; cursor: pointer; }
[hidden] { display: none !important; }

@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes alarm { 50% { background: #b95f55; } }

@media (max-width: 800px) {
  .casebar { min-height: 68px; grid-template-columns: auto 1fr auto; padding: .55rem .75rem; }
  .casebar__brand strong { display: none; }
  .progress span { font-size: 0; }
  .progress span::after { content: "Enquête"; font-size: .62rem; }
  .clue-toggle { font-size: 0; padding: .35rem; border: 0; }
  .clue-toggle::before { content: "Indices"; font-size: .6rem; }
  .cover { min-height: calc(100svh - 68px); align-items: end; }
  .cover__art { object-position: 68% center; }
  .cover__shade { background: linear-gradient(0deg, rgba(14,12,9,.99) 0%, rgba(14,12,9,.82) 55%, rgba(14,12,9,.12) 100%); }
  .cover__copy { padding: 2rem 1.15rem 2.5rem; }
  .cover h1 { font-size: clamp(3.5rem, 17vw, 6rem); }
  .brief { line-height: 1.5; }
  .case-layout { display: block; }
  .case-art { min-height: 36vh; border-right: 0; border-bottom: 1px solid #786c5b; }
  .case-art img { object-position: center; }
  .case-file { padding: 2.25rem 1.15rem 4rem; }
  .case-file h1 { font-size: clamp(2.8rem, 13vw, 4.4rem); }
  .choice { width: 100%; }
  .toolbox { grid-template-columns: 1fr; }
  .toolbox button, .toolbox p, .toolbox div { grid-column: 1; }
  .code-lock div { display: grid; }
  .verdict { grid-template-columns: 1fr; }
  .verdict__yes, .verdict__no { min-height: 72px; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}
