/* ============================================================
   РќР• РћР‘РћР РђР§РР’РђР™РЎРЇ вЂ” Р°РЅР°Р»РѕРіРѕРІС‹Р№ С…РѕСЂСЂРѕСЂ РЅР° РѕРґРЅРѕРј СЌРєСЂР°РЅРµ
   РїР°Р»РёС‚СЂР°: РїРѕС‡С‚Рё-С‡С‘СЂРЅС‹Р№, РєРѕСЃС‚СЊ, РєСЂРѕРІСЊ
   ============================================================ */
:root {
  --ink: #07070a;
  --ink-2: #0d0d11;
  --bone: #ece6d8;
  --bone-dim: #b9b3a4;
  --dim: #7d786e;
  --red: #b33327;
  --red-dark: #7e1f17;
  --line: rgba(236, 230, 216, .14);
  --mono: ui-monospace, "Cascadia Mono", "SF Mono", Consolas, monospace;
  --serif: Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--ink);
  color: var(--bone);
  font: 15px/1.55 var(--mono);
  min-height: 100svh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ---------------------------------------------------------- С‚РµРєСЃС‚СѓСЂС‹ */
.texture { position: fixed; inset: 0; pointer-events: none; z-index: 40; }

.grain {
  position: absolute; inset: -50%;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/><feColorMatrix type='saturate' values='0'/></filter><rect width='120' height='120' filter='url(%23n)' opacity='.55'/></svg>");
  opacity: .07;
  animation: grain 1.1s steps(3) infinite;
}

@keyframes grain {
  0% { transform: translate(0, 0); }
  33% { transform: translate(-2%, 1%); }
  66% { transform: translate(1%, -2%); }
  100% { transform: translate(0, 0); }
}

.scan {
  position: absolute; inset: 0;
  background: repeating-linear-gradient(to bottom,
    rgba(255, 255, 255, .035) 0 1px, transparent 1px 3px);
  opacity: .55;
  mix-blend-mode: screen;
}

.vignette {
  position: absolute; inset: 0;
  background:
    radial-gradient(120% 90% at 50% 45%, transparent 35%, rgba(0, 0, 0, .55) 78%, #000 100%),
    radial-gradient(60% 45% at 50% 0%, rgba(179, 51, 39, .06), transparent 70%);
}

.flash {
  position: absolute; inset: 0; background: #fff; opacity: 0;
  mix-blend-mode: screen; transition: opacity .06s linear;
}

/* ------------------------------------------------------------- HUD */
.hud {
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px clamp(16px, 3vw, 34px);
  font-size: 10.5px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--dim);
  position: relative; z-index: 30;
}

.hud b { color: var(--bone-dim); font-weight: 400; letter-spacing: .1em; }

.rec { display: inline-flex; align-items: center; gap: 9px; }

.rec i {
  width: 7px; height: 7px; border-radius: 50%; background: var(--red);
  box-shadow: 0 0 10px rgba(179, 51, 39, .8);
  animation: blink 1.6s ease-in-out infinite;
}

@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: .15; } }

.ch em { color: var(--dim); font-style: normal; }
.ch { color: var(--bone-dim); }

/* ----------------------------------------------------------- СЃС†РµРЅР° */
.stage { position: relative; display: grid; place-items: center; padding: 0 clamp(16px, 4vw, 40px); overflow: hidden; }

.scene { grid-area: 1 / 1; width: 100%; }
.scene[hidden] { display: none; }

/* -------------------------------------------------------- 1. РІС…РѕРґ */
.intro { max-width: 760px; align-self: center; justify-self: start; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  margin: 0 0 clamp(18px, 3vh, 34px);
  font-size: 10.5px; letter-spacing: .26em; text-transform: uppercase;
  color: var(--red);
}

.eyebrow .dot {
  width: 5px; height: 5px; border-radius: 50%; background: currentColor;
  box-shadow: 0 0 8px currentColor;
}

.intro h1 {
  margin: 0;
  font: 400 clamp(46px, 8.2vw, 96px)/0.94 var(--serif);
  letter-spacing: -.035em;
  color: var(--bone);
}

.lead {
  max-width: 46ch;
  margin: clamp(20px, 3.4vh, 34px) 0 0;
  color: var(--bone-dim);
  font-size: clamp(13.5px, 1.4vw, 16px);
  line-height: 1.7;
}

.cta { display: flex; align-items: center; gap: 20px; margin-top: clamp(26px, 4vh, 42px); flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; gap: 14px;
  padding: 17px 26px;
  background: transparent; color: var(--bone);
  border: 1px solid rgba(236, 230, 216, .55);
  font: 600 11.5px/1 var(--mono); letter-spacing: .2em; text-transform: uppercase;
  cursor: pointer; position: relative;
  transition: background .22s ease, border-color .22s ease, color .22s ease, transform .1s ease;
}

.btn::after {
  content: ""; position: absolute; inset: 4px; border: 1px solid transparent;
  transition: border-color .22s ease; pointer-events: none;
}

.btn:hover { background: var(--red); border-color: var(--red); }
.btn:hover::after { border-color: rgba(255, 255, 255, .25); }
.btn:active { transform: translateY(1px); }
.btn svg { transition: transform .22s ease; }
.btn:hover svg { transform: translateX(4px); }

.hint { font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--dim); }

.warn {
  margin: clamp(22px, 4vh, 40px) 0 0;
  font-size: 10px; letter-spacing: .1em; line-height: 1.8; text-transform: uppercase;
  color: #5f5b53; max-width: 52ch;
}

/* ------------------------------------------------------- 2. РєР°РјРµСЂР° */
.feed { position: absolute; inset: 0; }

.room { position: absolute; inset: 0; overflow: hidden; background: #040405; }

.wall {
  position: absolute; inset: 0 0 34% 0;
  background:
    radial-gradient(70% 55% at 50% 18%, #211d18 0%, #0b0a0c 55%, #050506 100%);
}

.floor {
  position: absolute; inset: 66% 0 0 0;
  background: linear-gradient(#0a0909, #101010 40%, #050505);
  transform: perspective(300px) rotateX(28deg); transform-origin: top;
  box-shadow: inset 0 30px 60px #000;
}

.lamp {
  position: absolute; left: 50%; top: 0; width: 46vmin; height: 62vmin;
  transform: translateX(-50%);
  background: radial-gradient(50% 55% at 50% 0%, rgba(214, 186, 138, .16), transparent 70%);
  filter: blur(6px);
  animation: flicker 5.5s linear infinite;
}

@keyframes flicker {
  0%, 100% { opacity: .85; }
  6% { opacity: .35; }
  7% { opacity: .9; }
  8% { opacity: .2; }
  9% { opacity: .8; }
  47% { opacity: .65; }
  48% { opacity: .25; }
  49% { opacity: .75; }
  72% { opacity: .9; }
  73% { opacity: .3; }
  74% { opacity: .85; }
}

.door {
  position: absolute; left: 50%; bottom: 22%; width: 27vmin; height: 58vmin;
  transform: translateX(-50%);
  background: radial-gradient(130% 95% at 50% 38%, #3a332a 0%, #221d17 48%, #0c0a09 100%);
  border: 2px solid #3a363c;
  box-shadow: 0 0 0 12px #0a0a0d, 0 0 40px rgba(0, 0, 0, .9), inset 0 0 80px rgba(0, 0, 0, .85);
}

.door::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(55% 45% at 50% 28%, rgba(226, 196, 142, .22), transparent 72%);
}

.door .gap {
  position: absolute; top: 0; right: 0; width: 16%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(226, 205, 164, .22));
  filter: blur(4px);
}

.figure {
  position: absolute; left: 50%; bottom: 0; width: 42%; height: 80%;
  transform: translateX(-50%) scale(.35);
  transform-origin: bottom center;
  filter: blur(.5px);
  opacity: 0;
}

.figure svg {
  display: block; width: 100%; height: 100%;
  fill: #000;
  filter: drop-shadow(0 0 18px rgba(0, 0, 0, .65));
}

body[data-stage="feed"] .figure { animation: approach 6.6s ease-in forwards; }

@keyframes approach {
  0% { opacity: 0; transform: translateX(-50%) scale(.32); }
  30% { opacity: .75; }
  100% { opacity: 1; transform: translateX(-50%) scale(1.35); }
}

.figure .eye {
  position: absolute; top: 17%; width: 7px; height: 4px; border-radius: 50%;
  background: #e2d9c2; opacity: 0;
  box-shadow: 0 0 8px rgba(226, 217, 194, .85);
}

.figure .eye.l { left: 43%; }
.figure .eye.r { left: 54%; }

body[data-stage="feed"] .figure .eye { animation: eyes 6.6s ease-in forwards; }

@keyframes eyes {
  0%, 55% { opacity: 0; }
  75% { opacity: .55; }
  100% { opacity: 1; }
}

.feed-hud {
  position: absolute; left: 0; right: 0; top: 0;
  display: flex; justify-content: space-between;
  padding: 18px clamp(16px, 3vw, 34px);
  font-size: 10px; letter-spacing: .2em; color: rgba(236, 230, 216, .45);
  text-transform: uppercase;
}

.log {
  position: absolute; left: clamp(16px, 3vw, 34px); bottom: clamp(18px, 4vh, 40px);
  margin: 0; padding: 0; list-style: none;
  font-size: 11px; line-height: 2.05; letter-spacing: .06em;
  color: rgba(236, 230, 216, .55);
}

.log li {
  opacity: 0; transform: translateY(4px);
  transition: opacity .3s ease, transform .3s ease;
  white-space: nowrap;
}

.log li.on { opacity: 1; transform: none; }
.log li:last-child.on { color: var(--red); }
.log .t { color: #514d46; margin-right: 12px; }

.stop {
  position: absolute; right: clamp(16px, 3vw, 34px); bottom: clamp(18px, 4vh, 40px);
  background: none; border: 0; color: #4c4842;
  font: 10px var(--mono); letter-spacing: .2em; text-transform: uppercase;
  cursor: pointer; padding: 8px;
}

.stop:hover { color: var(--bone-dim); }

/* ------------------------------------------------------ 3. СЃРєСЂРёРјРµСЂ */
.scare {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  background: #000;
  z-index: 25;
}

.face-wrap { position: relative; width: min(92vw, 78vh); }

.face {
  display: block; width: 100%; height: auto;
  filter: contrast(1.12) saturate(.75) brightness(1.02);
  animation: lunge .5s cubic-bezier(.16, .84, .3, 1) both;
}

@keyframes lunge {
  0% { transform: scale(.7) translateY(4%); opacity: .2; }
  60% { opacity: 1; }
  100% { transform: scale(1.04) translateY(0); opacity: 1; }
}

.glitch {
  position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(90deg, rgba(255, 0, 0, .08) 0 2px, transparent 2px 5px);
  mix-blend-mode: screen; opacity: .5;
  animation: glitch .12s steps(2) infinite;
}

@keyframes glitch {
  0% { transform: translateX(0); }
  50% { transform: translateX(3px); }
  100% { transform: translateX(-2px); }
}

body.shake .scare { animation: shake .09s linear infinite; }

@keyframes shake {
  0% { transform: translate(0, 0) rotate(0); }
  25% { transform: translate(-7px, 4px) rotate(-.6deg); }
  50% { transform: translate(6px, -5px) rotate(.5deg); }
  75% { transform: translate(-4px, -3px) rotate(-.4deg); }
  100% { transform: translate(5px, 6px) rotate(.3deg); }
}

/* ------------------------------------------------- 4. СЂР°Р·РѕР±Р»Р°С‡РµРЅРёРµ */
.reveal { justify-self: center; max-width: 660px; }

.card {
  position: relative;
  background: var(--bone); color: #14140f;
  padding: clamp(26px, 4vw, 46px);
  box-shadow: 0 40px 120px rgba(0, 0, 0, .75), 0 0 0 1px rgba(0, 0, 0, .2);
  animation: rise .5s cubic-bezier(.2, .8, .3, 1) both;
}

@keyframes rise { from { opacity: 0; transform: translateY(14px); } }

.card::before {
  content: "розыгрыш";
  position: absolute; top: -13px; left: 26px;
  background: var(--red); color: #fff;
  font: 700 10px/1 var(--mono); letter-spacing: .3em; text-transform: uppercase;
  padding: 8px 12px 7px;
}

.eyebrow.dark { color: #6b6559; margin-bottom: 12px; }

.card h2 {
  margin: 0 0 14px;
  font: 400 clamp(34px, 5vw, 54px)/1 var(--serif);
  letter-spacing: -.03em;
}

.card-lead { margin: 0 0 26px; color: #3a3830; max-width: 44ch; font-size: 13px; line-height: 1.65; }

.data { margin: 0 0 24px; display: grid; gap: 0; }

.data > div {
  display: grid; grid-template-columns: 120px 1fr; gap: 16px;
  padding: 11px 0; border-top: 1px dashed rgba(20, 20, 15, .22);
  align-items: baseline;
}

.data > div:last-child { border-bottom: 1px dashed rgba(20, 20, 15, .22); }

.data dt {
  font-size: 9.5px; letter-spacing: .2em; text-transform: uppercase; color: #6f695d;
}

.data dd {
  margin: 0; font-size: 13.5px; color: #14140f;
  word-break: break-word;
}

.fine { margin: 0 0 26px; font-size: 10.5px; line-height: 1.8; color: #6f695d; max-width: 52ch; }


.card-actions { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }

.btn.dark {
  border-color: #14140f; color: #14140f; padding: 14px 22px; font-size: 10.5px;
}

.btn.dark::after { border-color: transparent; }
.btn.dark:hover { background: #14140f; color: var(--bone); }
.btn.dark:hover::after { border-color: rgba(236, 230, 216, .2); }

.link {
  background: none; border: 0; padding: 0; cursor: pointer;
  color: #6f695d; font: 10.5px var(--mono); letter-spacing: .08em;
  border-bottom: 1px solid rgba(20, 20, 15, .3);
}

.link:hover { color: #14140f; }

/* -------------------------------------------------------- РїРѕРґРІР°Р» */
.bar {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 18px clamp(16px, 3vw, 34px) 22px;
  font-size: 9.5px; letter-spacing: .18em; text-transform: uppercase;
  color: #4f4b44; position: relative; z-index: 30;
}

.sound {
  background: none; border: 0; color: #6a665e; cursor: pointer;
  font: 10px var(--mono); letter-spacing: .16em; text-transform: uppercase;
  padding: 6px 0;
}

.sound:hover { color: var(--bone-dim); }

/* ----------------------------------------------------- СЃРјРµРЅР° СЃС†РµРЅС‹ */
.hud, .bar { transition: opacity .28s ease; }

body[data-stage="feed"] .hud { opacity: 0; pointer-events: none; }
body[data-stage="scare"] .hud,
body[data-stage="scare"] .bar { opacity: 0; pointer-events: none; }

body[data-stage="reveal"] { overflow: auto; }
body[data-stage="reveal"] .stage { overflow: auto; padding-block: 14px; }

/* ------------------------------------------------------- РјРѕР±РёР»РєРё */
@media (max-width: 640px) {
  .intro { justify-self: stretch; }
  .cta { gap: 14px; }
  .hint { display: none; }
  .warn { font-size: 9px; }
  .data > div { grid-template-columns: 92px 1fr; gap: 12px; }
  .card { padding: 28px 22px 26px; }
  .log { font-size: 10px; }
  .feed-hud { font-size: 9px; }
}

@media (max-height: 620px) {
  .intro h1 { font-size: clamp(34px, 7vh, 60px); }
  .lead, .warn { display: none; }
  .cta { margin-top: 20px; }
}

/* ------------------------------------------------- СѓРІР°Р¶РµРЅРёРµ Рє РїРѕРєРѕСЋ */
@media (prefers-reduced-motion: reduce) {
  .grain, .lamp, .glitch, .rec i { animation: none; }
  body.shake .scare { animation: none; }
  .figure, .figure .eye { animation-duration: 4s; }
  .card { animation: none; }
}

