
@import url('https://fonts.googleapis.com/css2?family=PT+Mono&family=Oswald:wght@400;700&display=swap');

*{margin:0;padding:0;box-sizing:border-box;}
html {
  max-width: 100%;
  overflow-x: clip;
}

body {
  background: #080d13;
  min-height: 100vh;
  max-width: 100%;
  font-family: 'PT Mono', monospace;
  color: #a0a890;
  position: relative;
  overflow-x: clip;
}

/* BG layers */
.bg { position: fixed; inset: 0; z-index: 0;
  background: radial-gradient(ellipse 100% 80% at 50% 20%, #0c1822 0%, #04122e 70%); }
.bg-noise { position: fixed; inset: 0; z-index: 1; opacity: 0.45; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 256px; }
.bg-vignette { position: fixed; inset: 0; z-index: 2; pointer-events: none;
  background: radial-gradient(ellipse 85% 75% at 50% 50%, transparent 30%, rgba(0,0,0,0.92) 100%); }
.bg-lines { position: fixed; inset: 0; z-index: 3; pointer-events: none;
  background: repeating-linear-gradient(0deg, transparent, transparent 3px, rgba(0,0,0,0.06) 3px, rgba(0,0,0,0.06) 4px); }

/* LIGHTNING */


/* PAGE */
.page {
  position: relative;
  z-index: 10;
  max-width: 860px;
  margin: 0 auto;
  padding: 40px 30px 40px;
  overflow-x: clip;
}

/* BACK BUTTON */
.back-btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: 'PT Mono', monospace; font-size: 10px; letter-spacing: 3px;
  color: rgba(80,120,160,0.7); text-decoration: none; text-transform: uppercase;
  border: 1px solid rgba(40,80,130,0.3); padding: 6px 14px;
  transition: all 0.2s ease; margin-bottom: 30px; display: inline-block;
  cursor: pointer; background: none;
}
.back-btn:hover { color: rgba(120,170,220,0.9); border-color: rgba(80,140,200,0.5); }

/* CASE HEADER */
.case-header { border: 1px solid rgba(40,70,120,0.4); padding: 18px 24px; margin-bottom: 0;
  background: linear-gradient(180deg, rgba(12,22,35,0.8) 0%, rgba(8,14,22,0.8) 100%);
  position: relative; }
.case-header::before { content:''; position:absolute; inset:4px; border:1px solid rgba(40,70,120,0.15); pointer-events:none; }

.case-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 12px; }
.case-num { font-family:'PT Mono',monospace; font-size:9px; letter-spacing:4px; color:rgba(60,100,150,0.7); text-transform:uppercase; }
.case-status { font-family:'Oswald',sans-serif; font-size:11px; letter-spacing:3px;
  color: rgba(180,30,30,0.85); border:1.5px solid rgba(160,20,20,0.7); padding:3px 10px; text-transform:uppercase; }
.case-status.green { color:rgba(40,160,80,0.85); border-color:rgba(30,140,70,0.7); }
.case-status.blue { color:rgba(60,120,200,0.85); border-color:rgba(50,100,180,0.7); }

.story-title { font-family:'PT Mono',monospace; font-size:10px; letter-spacing:3px;
  color:rgba(80,110,100,0.7); text-transform:uppercase; margin-bottom:6px; }
.story-name { font-family:'Oswald',sans-serif; font-size:clamp(22px,4vw,36px);
  letter-spacing:5px; color:#5a9acc; text-transform:uppercase; line-height:1.1;
  text-shadow:0 0 30px rgba(58,154,204,0.3); }
.case-date { font-family:'PT Mono',monospace; font-size:9px; letter-spacing:2px;
  color:rgba(70,100,80,0.6); margin-top:8px; }

/* LEAD */
.story-lead {
  background: rgba(10,18,28,0.7); border-left: 3px solid rgba(58,154,204,0.4);
  padding: 14px 20px; margin: 20px 0;
  font-family:'PT Mono',monospace; font-size:14px; line-height:1.7;
  color:rgba(160,180,160,0.85); letter-spacing:0.5px;
}

/* DIVIDER */
.div-line { height:1px; background:linear-gradient(90deg,transparent,rgba(40,70,120,0.5) 20%,rgba(40,70,120,0.5) 80%,transparent); margin:20px 0; }

/* STORY ILLUSTRATIONS */
.story-figure {
  display: block;
  margin: 30px 0 34px;
}
.story-figure__button {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}
.story-figure__button::after {
  content: "Нажми на фото";
  display: block;
  margin-top: 8px;
  font-family: 'PT Mono', monospace;
  font-size: 10px;
  line-height: 1.2;
  letter-spacing: 1.5px;
  color: rgba(78,70,52,0.62);
  text-align: center;
  text-transform: uppercase;
  text-decoration: none;
}
.story-figure__image {
  display: block;
  width: 100%;
  height: auto;
  max-height: 520px;
  object-fit: contain;
  border: 1px solid rgba(40, 70, 120, 0.18);
  box-shadow:
    0 18px 44px rgba(0,0,0,0.34),
    0 0 0 1px rgba(255,255,255,0.14) inset;
  filter: contrast(1.03) saturate(0.92);
  transition: transform 0.18s ease, filter 0.18s ease, box-shadow 0.18s ease;
}
.story-figure__button:hover .story-figure__image,
.story-figure__button:focus-visible .story-figure__image {
  transform: translateY(-2px);
  filter: contrast(1.06) saturate(1);
  box-shadow:
    0 22px 52px rgba(0,0,0,0.4),
    0 0 0 2px rgba(58,154,204,0.22);
}
.story-figure__button:focus-visible {
  outline: 2px solid rgba(58,154,204,0.62);
  outline-offset: 4px;
}
.docx-chat-shot {
  display: block;
  width: 100%;
  margin: 18px 0 24px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}
.docx-chat-shot img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid rgba(40, 70, 120, 0.2);
  box-shadow: 0 6px 20px rgba(0,0,0,0.18);
}
.docx-chat-shot::after {
  content: "Нажми на фото";
  display: block;
  margin-top: 8px;
  font-family: 'PT Mono', monospace;
  font-size: 10px;
  line-height: 1.2;
  letter-spacing: 1.5px;
  color: rgba(78,70,52,0.62);
  text-align: center;
  text-transform: uppercase;
  text-decoration: none;
}
.docx-chat-shot:focus-visible {
  outline: 2px solid rgba(58,154,204,0.62);
  outline-offset: 4px;
}

/* BODY TEXT */
.story-body { margin: 24px 0; }

.story-para {
  font-family:'PT Mono',monospace; font-size:15px; line-height:2;
  color:#1a1a1a; margin-bottom:20px; letter-spacing:0.3px;
  white-space:pre-wrap;
}

.story-para.dialogue {
  border-left:3px solid rgba(80,60,30,0.4);
  padding-left:16px;
  color:#111;
  font-size:16px;
}
.story-para.episode-start {
  margin-top: 34px;
  padding: 18px 18px 18px 22px;
  border-left: 4px solid rgba(58,154,204,0.58);
  background: linear-gradient(90deg, rgba(58,154,204,0.13), rgba(58,154,204,0.03) 62%, transparent);
  box-shadow: inset 0 1px 0 rgba(58,154,204,0.14);
}
.episode-marker {
  display: inline-block;
  margin: 0 10px 8px 0;
  padding: 3px 9px 4px;
  font-family: 'PT Mono', monospace;
  font-size: 11px;
  line-height: 1.2;
  letter-spacing: 1.8px;
  color: #1f5f86;
  border: 1px solid rgba(58,154,204,0.42);
  background: rgba(58,154,204,0.12);
  text-transform: uppercase;
  text-shadow: 0 1px 0 rgba(255,255,255,0.45);
}

/* ── A4 PAPER PARALLAX ── */
.a4-paper-wrap {
  position: relative;
  max-width: 740px;
  margin: 36px auto 32px;
  background: #fff;
  padding: 90px 72px 72px;
  box-shadow:
    0 8px 40px rgba(0,0,0,0.7),
    0 2px 8px rgba(0,0,0,0.5),
    inset 0 0 0 1px rgba(200,190,160,0.2);
}

.a4-paper-wrap .story-lead {
  background: rgba(255,255,255,0);
  border-left: 3px solid rgba(80,60,20,0.35);
  color: #222;
  font-size: 15px;
  margin: 0 0 20px;
}

.a4-paper-wrap .div-line {
  background: linear-gradient(90deg, transparent, rgba(100,80,40,0.3) 20%, rgba(100,80,40,0.3) 80%, transparent);
}

.a4-paper-wrap .story-footer {
  border-top-color: rgba(100,80,40,0.25);
}
.a4-paper-wrap .nav-btn {
  color: rgba(60,80,120,0.75);
  border-color: rgba(60,80,120,0.3);
}
.a4-paper-wrap .nav-btn:hover { color: rgba(30,60,140,0.9); border-color: rgba(30,60,140,0.5); }
.a4-paper-wrap .story-counter { color: rgba(80,70,50,0.7); }

/* CENSOR BARS */
.censor { display:inline-block; background:#1a1a18; color:transparent; user-select:none; border-radius:1px; vertical-align:middle; }

/* FOOTER NAV */
.story-footer { border-top:1px solid rgba(40,70,120,0.3); padding-top:20px; margin-top:40px;
  display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap; gap:12px; }
.nav-btn {
  font-family:'PT Mono',monospace; font-size:9px; letter-spacing:3px; color:rgba(60,100,150,0.7);
  border:1px solid rgba(40,80,130,0.3); padding:7px 14px; cursor:pointer;
  background:none; text-transform:uppercase; transition:all 0.2s ease;
}
.nav-btn:hover { color:rgba(120,170,220,0.9); border-color:rgba(80,140,200,0.5); }
.nav-btn:disabled,
.nav-btn.is-disabled {
  opacity:0.25;
  cursor:default;
  pointer-events:none;
}
.story-counter { font-family:'PT Mono',monospace; font-size:9px; letter-spacing:2px; color:rgba(60,80,70,0.6); }

/* RESPONSIVE */
@media(max-width:600px){
  /* PAGE */
  .page { padding: 16px 12px 60px; overflow-x: hidden; width: 100%; }
  .a4-paper-wrap { width: 100%; box-sizing: border-box; overflow: hidden; }

  /* BACK BUTTON */
  .back-btn { display: block; text-align: center; margin-bottom: 16px; }

  /* CASE HEADER */
  .case-header { padding: 14px 14px; }
  .case-top { flex-direction: column; gap: 10px; align-items: center; text-align: center; }
  .case-num { letter-spacing: 2px; }
  .story-name { font-size: clamp(18px, 6vw, 26px); letter-spacing: 2px; }
  .case-date { font-size: 8px; letter-spacing: 1px; }

  /* LEAD */
  .story-lead { font-size: 12px; padding: 12px 14px; }

  /* A4 PAPER */
  .a4-paper-wrap {
    padding: 30px 16px 40px;
    margin: 16px 0 18px;
    box-sizing: border-box;
    width: 100%;
  }

  /* BODY TEXT */
  .story-para { font-size: 13px; line-height: 1.8; }
  .story-para.dialogue { font-size: 13px; }
  .story-para.episode-start { margin-top: 24px; padding: 14px 14px 14px 16px; }
  .episode-marker { font-size: 10px; letter-spacing: 1.2px; }

  /* ILLUSTRATIONS */
  .story-figure { margin: 22px 0 26px; }
  .story-figure__image { max-height: 320px; }

  /* FOOTER NAV */
  .story-footer { flex-direction: column; align-items: center; gap: 10px; padding-top: 16px; }
  .nav-btn { width: 100%; text-align: center; }
}

.image-viewer {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: clamp(16px, 3vw, 42px);
  background:
    radial-gradient(ellipse 80% 70% at 50% 42%, rgba(21,35,47,0.86), rgba(4,8,12,0.98) 72%),
    rgba(2,5,8,0.96);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .2s ease, visibility .2s ease;
}
.image-viewer.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.image-viewer::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(0deg, transparent, transparent 3px, rgba(255,255,255,.025) 3px, rgba(255,255,255,.025) 4px),
    url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: auto, 220px;
  opacity: .24;
  pointer-events: none;
}
.image-viewer__frame {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: min(100%, 1180px);
  max-height: calc(100vh - clamp(32px, 6vw, 84px));
}
.image-viewer__image {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - clamp(92px, 12vw, 150px));
  width: auto;
  height: auto;
  object-fit: contain;
  background: rgba(10,12,14,.62);
  border: 1px solid rgba(174,198,210,.28);
  box-shadow:
    0 26px 90px rgba(0,0,0,.72),
    0 0 0 1px rgba(255,255,255,.08);
}
.image-viewer__close {
  position: fixed;
  top: clamp(14px, 2vw, 26px);
  right: clamp(14px, 2vw, 28px);
  z-index: 2;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(80,140,200,.52);
  background: rgba(8,13,19,.82);
  color: #9dd6ee;
  font-family: 'PT Mono', monospace;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(0,0,0,.45);
  transition: border-color .18s ease, color .18s ease, transform .18s ease;
}
.image-viewer__close:hover,
.image-viewer__close:focus-visible {
  border-color: rgba(157,214,238,.9);
  color: #d8f6ff;
  transform: translateY(-1px);
  outline: none;
}
html.viewer-open,
body.viewer-open {
  overflow: hidden;
  overscroll-behavior: none;
}
body.viewer-open {
  position: fixed;
  width: 100%;
}
.image-viewer.is-open {
  touch-action: none;
}

/* ── PETALS ── */
.petal {
  position: absolute;
  pointer-events: none;
  z-index: 5;
  background: url('../assets/petals.png') no-repeat center / contain;
}

/* ── HAND REDACT ── */
.hand-redact {
  display: inline-block;
  background: url('../assets/brushstroke.png') no-repeat center / 100% 100%;
  color: transparent;
  user-select: none;
  vertical-align: middle;
  height: 1.8em;
  margin: 0 2px;
  position: relative;
  bottom: 0.1em;
}


/* ── PRELOADER ── */
#preloader {
  position: fixed; inset: 0; z-index: 99999;
  background: #080d13;
  display: flex; align-items: center; justify-content: center;
  transition: opacity 0.7s ease;
}
#preloader.fade-out { opacity: 0; pointer-events: none; }
.pre-inner { text-align: center; width: 300px; }
.pre-title {
  font-family: 'PT Mono', monospace; font-size: 9px;
  letter-spacing: 5px; color: rgba(80,120,160,0.8);
  text-transform: uppercase; margin-bottom: 8px;
}
.pre-sub {
  font-family: 'PT Mono', monospace; font-size: 7px;
  letter-spacing: 2px; color: rgba(50,80,110,0.5);
  margin-bottom: 32px;
}
.pre-bar-wrap {
  width: 100%; height: 1px;
  background: rgba(40,70,120,0.2); margin-bottom: 14px;
}
.pre-bar {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, rgba(30,90,180,0.6), rgba(80,160,220,1));
  box-shadow: 0 0 10px rgba(80,160,220,0.6);
  transition: width 0.12s linear;
}
.pre-pct {
  font-family: 'PT Mono', monospace; font-size: 10px;
  letter-spacing: 3px; color: rgba(70,110,150,0.7);
}

/* ── PAGE FADE-IN ── */
.page { opacity: 0; }
body.loaded .page { animation: pageFadeIn 0.9s ease 0.1s forwards; }
@keyframes pageFadeIn {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
