/* ==========================================================
   ЛЕПРОЗОРИУМ — обитель прокажённых
   Стиль: чёрная готика средневекового лепрозория
   ========================================================== */

:root {
  --black: #0d0a07;
  --parch: #e6d8b8;
  --parch-dim: #9c8c6d;
  --blood: #a3231b;
  --blood-bright: #c93a2b;
  --gold: #b08d3f;
  --bone: #cfc4a8;
  --font-goth: "Cormorant Unicase", serif;
  --font-mono: "JetBrains Mono", monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  background: var(--black);
  color: var(--parch);
  font-family: var(--font-goth);
  font-size: 19px;
  line-height: 1.55;
  overflow-x: hidden;
}

::selection { background: var(--blood); color: var(--parch); }

.mono { font-family: var(--font-mono); }

.mark {
  color: var(--blood-bright);
  text-shadow: 0 0 18px rgba(201, 58, 43, .55);
}

/* ---------- текстуры поверх всего ---------- */

.grain {
  position: fixed; inset: -50%;
  width: 200%; height: 200%;
  pointer-events: none; z-index: 40;
  opacity: .5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.06 0'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 9s steps(6) infinite;
}
@keyframes grain {
  0%,100% { transform: translate(0,0); }
  20% { transform: translate(-3%, 2%); }
  40% { transform: translate(2%, -3%); }
  60% { transform: translate(-2%, -2%); }
  80% { transform: translate(3%, 3%); }
}

.vignette {
  position: fixed; inset: 0;
  pointer-events: none; z-index: 30;
  background: radial-gradient(ellipse 90% 80% at 50% 45%, transparent 55%, rgba(0,0,0,.75) 100%);
}

.vapor {
  position: fixed; inset: 0;
  pointer-events: none; z-index: 5;
  background:
    radial-gradient(ellipse 60% 40% at 30% 110%, rgba(120, 90, 40, .10), transparent 70%),
    radial-gradient(ellipse 50% 35% at 80% 115%, rgba(100, 60, 30, .12), transparent 70%);
  animation: vapor 14s ease-in-out infinite alternate;
}
@keyframes vapor {
  from { opacity: .6; transform: translateY(0); }
  to   { opacity: 1;  transform: translateY(-2%); }
}

/* ---------- HERO (единственная страница) ---------- */

.hero {
  min-height: 100svh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center;
  position: relative;
  padding: 80px 20px 60px;
}

.hero-eyebrow {
  font-size: 12px;
  letter-spacing: .42em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 26px;
}

.hero-title {
  font-size: clamp(40px, 10.5vw, 110px);
  font-weight: 700;
  letter-spacing: .06em;
  line-height: 1;
  color: var(--parch);
  position: relative;
  text-shadow: 0 0 40px rgba(201, 58, 43, .35);
}
/* глитч */
.hero-title::before, .hero-title::after {
  content: attr(data-text);
  position: absolute; inset: 0;
  overflow: hidden;
  opacity: .8;
}
.hero-title::before {
  color: var(--blood-bright);
  animation: glitch-a 3.1s infinite steps(1);
}
.hero-title::after {
  color: #4d6b8a;
  animation: glitch-b 2.7s infinite steps(1);
}
@keyframes glitch-a {
  0%, 91%, 100% { clip-path: inset(0 0 100% 0); transform: none; }
  92% { clip-path: inset(12% 0 62% 0); transform: translate(-3px, -1px); }
  94% { clip-path: inset(64% 0 8% 0);  transform: translate(3px, 1px); }
  96% { clip-path: inset(38% 0 40% 0); transform: translate(-2px, 0); }
  98% { clip-path: inset(80% 0 4% 0);  transform: translate(2px, 1px); }
}
@keyframes glitch-b {
  0%, 89%, 100% { clip-path: inset(0 0 100% 0); transform: none; }
  90% { clip-path: inset(70% 0 10% 0); transform: translate(2px, 0); }
  93% { clip-path: inset(20% 0 70% 0); transform: translate(-3px, 1px); }
  97% { clip-path: inset(50% 0 30% 0); transform: translate(2px,-1px); }
}

.hero-sub {
  margin-top: 26px;
  font-size: clamp(18px, 2.6vw, 26px);
  color: var(--bone);
  max-width: 640px;
}

/* штамп карантина */
.stamp {
  display: inline-block;
  margin-top: 52px;
  padding: 10px 26px;
  border: 3px double var(--blood);
  color: var(--blood-bright);
  font-size: clamp(18px, 3vw, 28px);
  letter-spacing: .3em;
  transform: rotate(-6deg);
  text-transform: uppercase;
  opacity: .9;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='r'%3E%3CfeTurbulence baseFrequency='0.35' numOctaves='3'/%3E%3CfeDisplacementMap in='SourceGraphic' scale='4'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23r)'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='r'%3E%3CfeTurbulence baseFrequency='0.35' numOctaves='3'/%3E%3CfeDisplacementMap in='SourceGraphic' scale='4'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23r)'/%3E%3C/svg%3E");
  animation: stamp-in .5s cubic-bezier(.2, 2.2, .4, 1) .8s both;
}
@keyframes stamp-in {
  from { opacity: 0; transform: rotate(-6deg) scale(2.2); }
  to   { opacity: .9; transform: rotate(-6deg) scale(1); }
}
.stamp-note {
  margin-top: 14px;
  font-size: 12px;
  letter-spacing: .12em;
  color: var(--parch-dim);
}

/* ---------- FOOTER ---------- */

.foot {
  padding: 0 20px 46px;
}
.foot-line {
  text-align: center;
  font-size: 11px;
  letter-spacing: .32em;
  text-transform: uppercase;
  color: var(--parch-dim);
}

/* ---------- МОБИЛЬНЫЕ ---------- */

@media (max-width: 600px) {
  .hero { padding: 56px 20px 40px; }

  /* зерно на слабом железе лучше не анимировать — дешевле отрисовка */
  .grain { animation: none; opacity: .35; }

  .hero-eyebrow { letter-spacing: .3em; }

  .stamp {
    margin-top: 40px;
    padding: 8px 18px;
    letter-spacing: .22em;
  }
  .stamp-note {
    letter-spacing: .06em;
    font-size: 12px;
    max-width: 320px;
    margin-inline: auto;
  }

  .foot {
    /* не давить на home-индикатор iOS */
    padding-bottom: calc(34px + env(safe-area-inset-bottom, 0px));
  }
  .foot-line {
    font-size: 10px;
    letter-spacing: .24em;
    /* сужаем трекинг, чтобы «без mercy» не переносилось по одному слову */
    white-space: normal;
    line-height: 1.9;
  }
}

/* ---------- REVEAL ----------
   Скрыто только при включённом JS — иначе без JS вся страница невидима */

.js [data-reveal] {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity .8s ease, transform .8s ease;
}
.js [data-reveal].is-in {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .grain, .vapor { animation: none !important; }
  /* глитч-слои гасим полностью, штамп стоит сразу */
  .hero-title::before, .hero-title::after { display: none; }
  .stamp { animation: none; }
  [data-reveal] { transition: none; opacity: 1; transform: none; }
}
