/* Детективы онлайн — главная. Вся страница — тёмная комната со столом, курсор — луч фонаря.
   Свой стиль, не похожий ни на одно дело: почти чёрный, тёплый свет лампы накаливания, бумага, дидона Prata. */

@font-face { font-family: "Prata"; font-weight: 400; font-display: swap;
  src: url("../fonts/prata-cyrillic-400-normal.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Prata"; font-weight: 400; font-display: swap;
  src: url("../fonts/prata-latin-400-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122; }
@font-face { font-family: "Manrope"; font-weight: 300; font-display: swap;
  src: url("../fonts/manrope-cyrillic-300-normal.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Golos Text"; font-weight: 400; font-display: swap;
  src: url("../fonts/golos-text-cyrillic-400-normal.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Golos Text"; font-weight: 400; font-display: swap;
  src: url("../fonts/golos-text-latin-400-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122; }
@font-face { font-family: "Golos Text"; font-weight: 500; font-display: swap;
  src: url("../fonts/golos-text-cyrillic-500-normal.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Golos Text"; font-weight: 500; font-display: swap;
  src: url("../fonts/golos-text-latin-500-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122; }
@font-face { font-family: "Golos Text"; font-weight: 600; font-display: swap;
  src: url("../fonts/golos-text-cyrillic-600-normal.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }

:root {
  --ink: #07090d;        /* темнота комнаты */
  --wall: #0b0e14;       /* стена за столом */
  --lamp: #f0cf94;       /* тёплый свет фонаря */
  --paper: #ece6d8;      /* бумага, основной текст */
  --mute: #7f8796;       /* приглушённый текст */
  --stamp: #b23a2e;      /* штамп «Скоро» */
  --display: "Prata", "PT Serif", Georgia, serif;
  --text: "Golos Text", -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --x: 50vw; --y: 55vh; --r: 300px;
}
* { box-sizing: border-box; }
html { background: var(--ink); }
body.hub { margin: 0; color: var(--paper); font-family: var(--text); font-size: 16px; line-height: 1.5; background: var(--ink); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--lamp); outline-offset: 3px; }

/* комната: стена сверху, стол снизу, край стола — тонкая светлая линия */
.room { position: relative; min-height: 100vh; display: flex; flex-direction: column; isolation: isolate; overflow: hidden;
  background:
    linear-gradient(180deg, var(--wall) 0%, #0d1118 38%, #10151d 38.1%, #161b23 39%, #11161e 42%, #0c1017 100%); }
.room::before { /* волокна столешницы */ content: ""; position: absolute; inset: 39% 0 0; z-index: -1; opacity: .55;
  background: repeating-linear-gradient(91deg, rgba(255,255,255,.018) 0 2px, transparent 2px 9px), repeating-linear-gradient(89.4deg, rgba(0,0,0,.25) 0 1px, transparent 1px 23px); }
.grain { position: absolute; inset: 0; z-index: 5; pointer-events: none; opacity: .07; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>"); }

/* луч фонаря на всю комнату: вне круга — темнота, в круге — тёплый свет */
/* фонарь лежит поверх всего в комнате: заголовок, дела и шапка видны только в луче. Подвал — вне комнаты. */
.torch { position: absolute; inset: 0; z-index: 20; pointer-events: none;
  background:
    radial-gradient(circle var(--r) at var(--x) var(--y), rgba(240,207,148,.12) 0%, rgba(240,207,148,.04) 45%, rgba(0,0,0,0) 72%),
    radial-gradient(circle calc(var(--r) * 1.1) at var(--x) var(--y), rgba(4,5,8,0) 0%, rgba(4,5,8,0) 38%, rgba(4,5,8,.8) 70%, rgb(4,5,8) 94%); }
.room:not(.is-on) .torch { background: rgb(4,5,8); }
.room.is-out .torch { background: rgb(4,5,8); }

/* шапка */
.hub-top { position: relative; z-index: 6; display: flex; align-items: baseline; justify-content: space-between; padding: 26px clamp(22px, 5vw, 72px); }
.hub-brand { font-family: var(--display); font-size: 19px; letter-spacing: .02em; text-decoration: none; color: var(--paper); }
.hub-brand::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 12px; border-radius: 50%; background: var(--lamp); box-shadow: 0 0 14px 3px rgba(240,207,148,.55); vertical-align: 2px; }

/* заголовок на стене */
main { flex: 1; display: flex; flex-direction: column; }
.hub-hero { position: relative; z-index: 4; }
.hub-hero { padding: clamp(10px, 4vh, 44px) clamp(22px, 5vw, 72px) 0; max-width: 1320px; width: 100%; margin: 0 auto; }
.hub-title { margin: 0; max-width: 24ch; font-family: var(--display); font-weight: 400; font-size: clamp(34px, 4.6vw, 64px); line-height: 1.08; letter-spacing: -.005em; color: var(--paper); text-wrap: balance; }
.hub-lead { margin: 18px 0 0; max-width: 52ch; color: #a7acb6; font-size: clamp(15px, 1.15vw, 17px); line-height: 1.6; }

/* стол с тремя делами */
.desk { position: relative; width: 100%; max-width: 1320px; margin: auto auto 0; padding: clamp(36px, 7vh, 80px) clamp(22px, 4vw, 56px) clamp(40px, 7vh, 72px);
  display: grid; grid-template-columns: 1.15fr .9fr 1fr; gap: clamp(20px, 3vw, 48px); align-items: stretch; }
.desk__table { display: none; }

.case { position: relative; display: grid; grid-template-rows: minmax(390px, 1fr) auto; gap: 20px; justify-items: center; text-align: center; }
.case > .case__object { align-self: end; }
.case__label { align-self: start; }
.case__object { position: relative; z-index: 2; display: block; text-decoration: none; color: inherit; transition: transform .45s cubic-bezier(.2,.8,.2,1), filter .45s; filter: drop-shadow(0 24px 24px rgba(0,0,0,.6)); }
.case:hover .case__object, .case:focus-within .case__object, .case.is-open .case__object { transform: translateY(-10px) rotate(0deg) !important; filter: drop-shadow(0 38px 32px rgba(0,0,0,.65)); }
.case__label { position: relative; z-index: 5; display: grid; gap: 7px; justify-items: center; max-width: 34ch; }
.case__name { margin: 0; font-family: var(--display); font-weight: 400; font-size: clamp(25px, 2.1vw, 32px); line-height: 1.1; color: var(--paper); }
.case__tease { margin: 0; color: #a9aeb8; font-size: 14.5px; line-height: 1.55; }
.case__meta { margin: 2px 0 0; color: var(--mute); font-size: 13px; letter-spacing: .02em; }
.case__go, .case__notify { margin-top: 8px; font: inherit; font-weight: 500; font-size: 14.5px; padding: 11px 22px; border-radius: 999px; cursor: pointer; text-decoration: none; }
.case__go { background: var(--lamp); color: #1c1608; border: 0; transition: box-shadow .3s; }
.case__go:hover { box-shadow: 0 0 34px 2px rgba(240,207,148,.35); }
.case__notify { background: rgba(7,9,13,.4); color: var(--paper); border: 1px solid rgba(236,230,216,.25); }
.case__notify:hover { border-color: var(--lamp); color: var(--lamp); }
.is-soon .case__meta { display: none; }

/* штамп «Скоро» */
.stamp { position: absolute; top: -132px; right: -6px; z-index: 5; transform: rotate(-11deg); padding: 3px 12px; border: 2.5px solid var(--stamp); border-radius: 6px; color: var(--stamp);
  font-family: var(--text); font-weight: 600; font-size: 15px; letter-spacing: .14em; text-transform: uppercase; opacity: .9; mix-blend-mode: screen; pointer-events: none; }

/* дело 1: панель умного дома */
.obj-home { transform: rotate(-4deg); width: min(100%, 340px); }
.obj-home__glass { position: relative; display: grid; grid-template-rows: auto 1fr auto; justify-items: center; aspect-ratio: 16 / 11; padding: 16px 18px; border-radius: 22px;
  background: linear-gradient(160deg, #18242b, #0a1013 70%); border: 1px solid rgba(160,230,215,.16); box-shadow: inset 0 1px 0 rgba(255,255,255,.06); overflow: hidden; }
.obj-home__bar { width: 100%; display: flex; justify-content: space-between; align-items: baseline; font-size: 12px; color: #9fb4b2; }
.obj-home__bar b { color: #dfeeea; font-weight: 600; }
.obj-home__ring { --amp: 0; position: relative; align-self: center; width: 74px; height: 74px; border-radius: 50%; }
.obj-home__core { position: absolute; inset: 0; border-radius: 50%; border: 4px solid #3fc1a8;
  box-shadow: 0 0 calc(16px + var(--amp) * 30px) rgba(63,193,168,calc(.4 + var(--amp) * .4)), inset 0 0 calc(10px + var(--amp) * 14px) rgba(63,193,168,calc(.3 + var(--amp) * .4));
  transform: scale(calc(1 + var(--amp) * .09)); transition: transform .08s linear, box-shadow .08s linear, border-color .3s; animation: hidle 4s ease-in-out infinite; }
@keyframes hidle { 50% { box-shadow: 0 0 6px rgba(63,193,168,.15), inset 0 0 4px rgba(63,193,168,.12); } }
.obj-home__rw { position: absolute; inset: 0; border-radius: 50%; border: 2px solid #3fc1a8; opacity: 0; animation: hripple 3.2s ease-out infinite; }
.obj-home__rw + .obj-home__rw { animation-delay: 1.6s; }
@keyframes hripple { 0% { opacity: .5; transform: scale(1); } 45%, 100% { opacity: 0; transform: scale(1.7); } }
.obj-home__state { font-size: 12.5px; color: #c9d8d5; }
.obj-home__cam { position: absolute; right: 12px; bottom: 34px; width: 92px; aspect-ratio: 16 / 9; border-radius: 6px; overflow: hidden; border: 1px solid rgba(255,255,255,.12); }
.obj-home__cam img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1) contrast(1.1) brightness(.85); }
.obj-home__cam i { position: absolute; left: 5px; top: 3px; font-style: normal; font-size: 9px; color: #fff; text-shadow: 0 0 4px #000; }
.obj-home__cam i::before { content: ""; display: inline-block; width: 5px; height: 5px; margin-right: 4px; border-radius: 50%; background: #e0574b; vertical-align: 1px; animation: rec 1.4s steps(1) infinite; }
/* дело 1: ночь под рукой (js/hub-home.js) — план этажа, замки, журнал, 00:15 */
.obj-home__plan { position: absolute; left: 16px; top: 40px; width: 56%; height: 64%; pointer-events: none; opacity: calc(1 - var(--black, 0)); }
.obj-home__walls rect, .obj-home__walls line { fill: none; stroke: #5fd1b9; stroke-width: .11; stroke-opacity: .7; stroke-dasharray: 1; stroke-dashoffset: calc(1 - var(--draw, 0)); }
.obj-home__walls .is-out { stroke-opacity: .4; }
.obj-home__walls .is-fence { stroke-opacity: .3; }
.obj-home__lock { fill: #5fd1b9; opacity: calc(var(--draw, 0) * (1 - var(--black, 0))); transform-box: fill-box; transform-origin: center; transition: fill .25s, transform .25s; }
.obj-home__lock.is-shut { fill: #e26054; }
.obj-home__lock.is-click { transform: scale(1.8); }
.obj-home__lock.is-open { fill: #b8f5e6; transform: scale(1.6); }
@media (hover: hover) { .obj-home:hover, .obj-home:hover * { cursor: none; } }   /* над пультом курсор — кольцо Наты */
.obj-home.is-night .obj-home__ring { position: relative; z-index: 3; }
.obj-home.is-night .obj-home__core { animation: none; }
.obj-home.is-night .obj-home__rw { animation-duration: 1.1s; }
.obj-home.is-night .obj-home__rw + .obj-home__rw { animation-delay: .55s; }
@keyframes hripple2 { 0% { opacity: .55; transform: scale(1); } 100% { opacity: 0; transform: scale(1.7); } }
.obj-home.is-night .obj-home__rw { animation-name: hripple2; }
.obj-home__ring.is-glitch .obj-home__core { border-color: #e26054; box-shadow: 0 0 24px rgba(226,96,84,.55), inset 0 0 14px rgba(226,96,84,.4); }
.obj-home__ring.is-glitch .obj-home__rw, .obj-home__ring.is-angry .obj-home__rw { border-color: #e0574b; }
.obj-home__ring.is-angry .obj-home__core { animation: hangry .9s steps(1) infinite; }
@keyframes hangry {
  0% { border-color: #e0574b; box-shadow: 0 0 22px rgba(224,87,75,.75), inset 0 0 12px rgba(224,87,75,.5); }
  15% { border-color: #3fc1a8; }
  30% { border-color: #e0574b; box-shadow: -4px 0 0 rgba(224,87,75,.6), 4px 0 0 rgba(63,193,168,.6); }
  45% { border-color: #3fc1a8; }
  60%, 100% { border-color: #e0574b; box-shadow: 0 0 26px rgba(224,87,75,.7), inset 0 0 12px rgba(224,87,75,.45); } }
.obj-home__wave { position: absolute; z-index: 2; width: 34px; height: 34px; margin: -17px 0 0 -17px; border-radius: 50%; border: 2px solid #3fc1a8; pointer-events: none; animation: hwave 1.1s ease-out forwards; }
.obj-home__wave.is-red { border-color: #e0574b; }
@keyframes hwave { 0% { opacity: .6; transform: scale(1); } 100% { opacity: 0; transform: scale(2.6); } }
.obj-home__walls rect.is-hot { stroke: #e0574b; stroke-opacity: .95; fill: rgba(224,87,75,.08); }
.obj-home__tag { position: absolute; z-index: 4; transform: translate(-50%, -100%); white-space: nowrap; font-size: 9.5px; letter-spacing: .02em; color: #f0b1aa; background: rgba(20,8,8,.75); padding: 2px 6px; border-radius: 4px; opacity: 0; transition: opacity .2s; pointer-events: none; }
.obj-home__tag.is-on { opacity: 1; }
.obj-home__state { position: relative; z-index: 1; }
.obj-home.is-night .obj-home__state { font-variant-numeric: tabular-nums; }
.obj-home__cam { opacity: calc(1 - var(--black, 0) * .9); background: #050708; }
.obj-home__cam.is-off img { filter: grayscale(1) brightness(.35); }
.obj-home__cam.is-off::after { content: "запись остановлена"; position: absolute; inset: auto 0 6px; text-align: center; font-size: 8.5px; letter-spacing: .02em; color: #e8b3ad; }
.obj-home__cam.is-off i::before { animation: none; background: #6b6f73; }
.obj-home__cam.is-dark img { opacity: 0; }
.obj-home__cam.is-dark::after { content: ""; }
.obj-home__cam.is-glitch img { animation: camglitch .35s steps(3) 1; }
@keyframes camglitch { 0% { transform: translateX(-4px); filter: grayscale(1) contrast(2) brightness(1.4); } 50% { transform: translateX(3px) skewX(-6deg); } 100% { transform: none; } }
@keyframes rec { 50% { opacity: 0; } }

/* дело 2: портрет Вадима из букв его сообщений, через лицо — трещина с чужими словами */
.obj-portrait { width: min(100%, 320px); aspect-ratio: 80 / 79; cursor: crosshair; touch-action: none; }   /* рамка: буквы рисует js/mosaic.js поверх комнаты */
.case--portrait:hover .obj-portrait, .case--portrait:focus-within .obj-portrait, .case--portrait.is-open .obj-portrait { transform: none !important; }   /* рамка не подпрыгивает: буквы привязаны к её месту */
.obj-portrait .stamp { top: auto; bottom: -14px; right: -16px; }
.case--portrait .case__name { font-family: "Manrope", var(--text); font-weight: 300; letter-spacing: -.01em; }

/* дело 3: служебная записка с вымаранными строками */
.obj-paper { transform: rotate(-2.5deg); width: min(100%, 270px); }
.obj-paper__sheet { display: grid; gap: 6px; padding: 22px 20px 20px; aspect-ratio: 3 / 4; background:
    linear-gradient(180deg, rgba(0,0,0,.03), transparent 30%), #e7e0cf; color: #2b2a27; text-align: left;
  font-family: "PT Serif", Georgia, "Times New Roman", serif; font-weight: 400; font-size: 13px; line-height: 1.45; border-radius: 3px; box-shadow: inset 0 0 40px rgba(120,100,60,.18); }
.obj-paper__grif { justify-self: end; font-family: var(--text); font-size: 9.5px; letter-spacing: .08em; color: #7a2e25; border: 1px solid #7a2e25; padding: 1px 6px; transform: rotate(2deg); }
.obj-paper__title { font-style: italic; font-weight: 600; font-size: 17px; margin: 4px 0 2px; }
.obj-paper__row { font-size: 12px; color: #55524b; }
.obj-paper__body { margin-top: 6px; }
.obj-paper__sign { justify-self: end; margin-top: auto; font-size: 12px; color: #55524b; }
.obj-paper__sign i { display: inline-block; width: 56px; height: 14px; margin-left: 6px; border-bottom: 1px solid #55524b; background: radial-gradient(ellipse 60% 40% at 40% 60%, transparent 55%, #3b3b62 57%, transparent 62%); }
.redact { position: relative; border-radius: 1px; background: #121212; color: transparent; padding: 0 2px; transition: background .35s, color .35s; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.redact.is-lit { background: rgba(18,18,18,.16); color: #5a1d17; }

/* подписка «Сообщить, когда откроется» */
.sub { position: absolute; z-index: 6; left: 50%; bottom: -8px; transform: translate(-50%, 8px); width: min(320px, 92vw); padding: 18px 18px 16px; border-radius: 16px;
  background: #0f141f; border: 1px solid rgba(242,212,155,.22); box-shadow: 0 24px 60px -12px rgba(0,0,0,.8); text-align: left;
  display: grid; gap: 10px; opacity: 0; visibility: hidden; transition: opacity .25s, transform .25s, visibility 0s .25s; }
.case.is-open .sub, .sub:focus-within { opacity: 1; visibility: visible; transform: translate(-50%, 0); transition: opacity .25s, transform .25s; }
.sub__t { margin: 0; font-size: 14px; color: var(--paper); }
.sub__field input { width: 100%; font: inherit; font-size: 15px; padding: 10px 12px; border-radius: 10px; border: 1px solid rgba(232,226,212,.22); background: rgba(0,0,0,.3); color: var(--paper); }
.sub__field input:focus { outline: none; border-color: var(--lamp); }
.sub__field input.is-bad { border-color: #d0665a; }
.sub__check { display: grid; grid-template-columns: 18px 1fr; gap: 9px; align-items: start; font-size: 12.5px; line-height: 1.45; color: #aeb3bd; cursor: pointer; }
.sub__check input { width: 16px; height: 16px; margin: 1px 0 0; accent-color: var(--lamp); }
.sub__check a { color: var(--paper); }
.sub__btn { font: inherit; font-weight: 500; font-size: 15px; padding: 10px 18px; border-radius: 999px; border: 0; background: var(--lamp); color: #1c1608; cursor: pointer; }
.sub__btn:disabled { opacity: .35; cursor: default; }
.sub__ok { margin: 0; font-size: 14px; color: var(--lamp); }

/* подписка «Сообщить, когда откроется» */
.sub { position: absolute; z-index: 7; left: 50%; bottom: -8px; transform: translate(-50%, 8px); width: min(320px, 92vw); padding: 18px 18px 16px; border-radius: 16px;
  background: #0e1219; border: 1px solid rgba(240,207,148,.22); box-shadow: 0 24px 60px -12px rgba(0,0,0,.85); text-align: left;
  display: grid; gap: 10px; opacity: 0; visibility: hidden; transition: opacity .25s, transform .25s, visibility 0s .25s; }
.case.is-open .sub, .sub:focus-within { opacity: 1; visibility: visible; transform: translate(-50%, 0); transition: opacity .25s, transform .25s; }
.sub:focus-within, .case.is-open .sub { z-index: 25; }
.sub__t { margin: 0; font-size: 14px; color: var(--paper); }
.sub__field input { width: 100%; font: inherit; font-size: 15px; padding: 10px 12px; border-radius: 10px; border: 1px solid rgba(236,230,216,.2); background: rgba(0,0,0,.35); color: var(--paper); }
.sub__field input:focus { outline: none; border-color: var(--lamp); }
.sub__field input.is-bad { border-color: #d0665a; }
.sub__check { display: grid; grid-template-columns: 18px 1fr; gap: 9px; align-items: start; font-size: 12.5px; line-height: 1.45; color: #a9aeb8; cursor: pointer; }
.sub__check input { width: 16px; height: 16px; margin: 1px 0 0; accent-color: var(--lamp); }
.sub__check a { color: var(--paper); }
.sub__btn { font: inherit; font-weight: 500; font-size: 15px; padding: 10px 18px; border-radius: 999px; border: 0; background: var(--lamp); color: #1c1608; cursor: pointer; }
.sub__btn:disabled { opacity: .35; cursor: default; }
.sub__ok { margin: 0; font-size: 14px; color: var(--lamp); }

/* подвал: тихий, как подпись под делом */
.hub-foot { background: var(--ink); border-top: 1px solid rgba(255,255,255,.05); padding: 26px clamp(22px, 5vw, 72px) 34px; color: #5f6673; font-size: 12.5px; line-height: 1.6; }
.hub-foot__in { max-width: 1320px; margin: 0 auto; display: grid; grid-template-columns: 1fr auto; gap: 10px 40px; align-items: start; }
.hub-foot p { margin: 0; }
.hub-foot a { color: #8a919d; text-decoration: none; }
.hub-foot a:hover { color: var(--paper); }
.hub-foot__links { display: flex; flex-wrap: wrap; gap: 6px 18px; justify-content: flex-end; }

@media (max-width: 860px) {
  .obj-portrait .stamp { top: auto; bottom: -14px; right: -10px; }
  .room { background: linear-gradient(180deg, var(--wall) 0%, #0c1017 22%, #11161e 100%); }
  .room::before { inset: 22% 0 0; }
  .desk { grid-template-columns: 1fr; gap: 76px; padding-top: 64px; }
  .case { grid-template-rows: auto auto; }
  .stamp { top: -128px; right: 8%; }
  .hub-foot__in { grid-template-columns: 1fr; }
  .hub-foot__links { justify-content: flex-start; }
  .sub { position: relative; left: auto; bottom: auto; transform: none; width: 100%; max-height: 0; padding-top: 0; padding-bottom: 0; overflow: hidden; border-width: 0; }
  .sub:focus-within { opacity: 0; visibility: hidden; }
  .case.is-open .sub { opacity: 1; visibility: visible; transform: none; max-height: 520px; padding: 18px 18px 16px; border-width: 1px; }
}
@media (prefers-reduced-motion: reduce) {
  .obj-home__core, .obj-home__rw, .msg--typing u, .obj-home__cam i::before { animation: none; }
  .case__object { transition: none; }
}
