/* Преступление и наказание — its own look: a monthly instalment in The Russian Messenger, 1866, read with a fever.
   Yellow wallpaper, high-contrast serif, a heartbeat at the top of the page that rises towards the murder
   and the confession and calms down in Siberia. Everything is scoped to html[data-book="crime"]. */
@import url('/fonts/book-crime.css');

html[data-book="crime"]:is([lang=en],[lang=es],[lang=pt],[lang=fr],[lang=de],[lang=it],[lang=pl],[lang=cs],[lang=hr],[lang=tr],[lang=id],[lang=ru],[lang=sr]) {
  --display: 'Playfair Display', 'EB Garamond', Georgia, serif;
  --body: 'PT Serif', 'Literata', Georgia, serif;
}
html[data-book="crime"] { --pulse: #c0392b; }
html[data-book="crime"] body[data-theme='yellow'] { --bg: #e4d494; --ink: #241c0c; --muted: #665a31; --accent: #8e2414; --card: rgba(238, 226, 170, .93); --line: rgba(36, 28, 12, .2); }
html[data-book="crime"] body[data-theme='night']  { --accent: #e0853a; }
html[data-book="crime"] body[data-theme='room']   { --accent: #f0b35a; }

/* ---------- type ---------- */
html[data-book="crime"] :is(.cover h1, .part h2, .fin h2) { font-weight: 800; font-style: normal; letter-spacing: -.02em; }
html[data-book="crime"] .cover h1 { font-size: clamp(50px, 10vw, 160px); line-height: .92; }
html[data-book="crime"] .h { font-style: italic; font-weight: 600; }
html[data-book="crime"] .h::before { width: 100%; max-width: 6rem; height: 3px; border-top: 1px solid var(--accent); border-bottom: 1px solid var(--accent); background: none; }
html[data-book="crime"] .p.drop::first-letter { font-weight: 800; font-style: normal; }
html[data-book="crime"] .q blockquote { font-style: italic; font-weight: 400; }
html[data-book="crime"] .q blockquote::before { content: '—'; font-style: normal; font-size: 1em; line-height: 1; height: auto; margin-bottom: .3em; }
html[data-book="crime"] .q.hero blockquote::before { content: none; }

/* part headers: a new monthly instalment of the magazine */
html[data-book="crime"] .part { justify-content: center; }
html[data-book="crime"] .part-n { -webkit-text-stroke: 0; color: var(--accent); opacity: .08; font-weight: 800; }
html[data-book="crime"] .part h2 { font-size: clamp(60px, 10vw, 156px); }
html[data-book="crime"] .c-mast { position: relative; margin-bottom: 2.4em; padding: .6em 0; border-top: 3px double var(--ink); border-bottom: 3px double var(--ink); min-width: min(30rem, 80vw); font-family: 'Playfair Display', 'PT Serif', serif; }
html[data-book="crime"] .c-mast b { display: block; font-size: clamp(20px, 1rem + 1vw, 30px); font-weight: 600; letter-spacing: .14em; }
html[data-book="crime"] .c-mast span { display: flex; justify-content: center; font: 12px var(--ui); letter-spacing: .2em; color: var(--muted); margin-top: .3em; }

/* characters: calling cards */
html[data-book="crime"] .char { border-radius: 0; border: 1px solid var(--line); outline: 1px solid var(--line); outline-offset: -6px; padding: 1.6em 1.5em 1.5em; text-align: center; }
html[data-book="crime"] .char svg { margin: 0 auto; }
html[data-book="crime"] .char.main { display: block; }
html[data-book="crime"] .char h4 { font-weight: 600; font-style: italic; }

/* the name is a clue: "raskol" means a split */
html[data-book="crime"] .c-split { display: inline-grid; }
html[data-book="crime"] .c-split > span { grid-area: 1 / 1; transition: transform 1.2s cubic-bezier(.5, 0, .2, 1); }
html[data-book="crime"] .c-split > span:first-child { clip-path: polygon(0 0, 100% 0, 100% 38%, 0 62%); }
html[data-book="crime"] .c-split > span:last-child { clip-path: polygon(0 62%, 100% 38%, 100% 100%, 0 100%); }
html[data-book="crime"] .note.in .c-split > span:first-child { transform: translate(-.06em, -.08em) rotate(-2deg); }
html[data-book="crime"] .note.in .c-split > span:last-child { transform: translate(.06em, .08em) rotate(1deg); }

/* ---------- the fever ---------- */
html[data-book="crime"] .progress { opacity: 0; }
.c-ecg { position: fixed; z-index: 49; left: 0; top: 0; width: 100%; height: 22px; pointer-events: none; }
.c-heat { position: fixed; inset: 0; z-index: 29; pointer-events: none; opacity: 0; transition: opacity 1.5s;
  background: radial-gradient(ellipse at 50% 50%, transparent 52%, rgba(150, 30, 10, .55) 100%);
  animation: cbeat var(--beat, 1s) ease-out infinite; }
@keyframes cbeat { 0% { transform: scale(1); } 12% { transform: scale(1.025); } 30% { transform: scale(1); } }
body.c-quake .flow, body.c-quake .scene-sticky { animation: cquake .09s linear 7; }
@keyframes cquake { 25% { transform: translate(3px, -2px); } 50% { transform: translate(-3px, 1px); } 75% { transform: translate(2px, 2px); } }

@media (prefers-reduced-motion: reduce) {
  .c-heat { animation: none; }
  body.c-quake .flow, body.c-quake .scene-sticky { animation: none; }
}
