/* ==== ТЕМНЫЙ ПРИНЦ — system ==== */
:root {
  --void: #07050c;
  --black: #0d0915;
  --deep: #14091f;
  --purple: #1a0b2e;
  --purple-mid: #3a1a5c;
  --lavender: oklch(0.78 0.18 295);
  --lavender-dim: oklch(0.55 0.15 295);
  --blood: oklch(0.55 0.22 25);
  --ash: #7a6b8c;
  --bone: #d8ccf0;
  --white: #f2ecff;

  /* Display / headings — thin elegant serif with Cyrillic */
  --f-gothic: 'Cormorant Garamond', 'Times New Roman', serif;
  /* Latin-only blackletter for english glyphs */
  --f-fraktur: 'UnifrakturMaguntia', 'UnifrakturCook', serif;
  --f-serif: 'Cormorant Garamond', 'Times New Roman', serif;
  --f-mono: 'JetBrains Mono', 'Courier New', monospace;
  --f-sans: 'Inter', system-ui, sans-serif;
}

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

html, body {
  background: var(--void);
  color: var(--bone);
  font-family: var(--f-serif);
  font-size: 18px;
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
  cursor: none;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* Force text presentation for cross glyphs (iOS/Android otherwise paint them as emoji). */
.cross, .floating-cross, .btn::before, .cross-text {
  font-variant-emoji: text;
}

/* CRT / VHS overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9000;
  background:
    repeating-linear-gradient(
      0deg,
      rgba(0,0,0,0.18) 0px,
      rgba(0,0,0,0.18) 1px,
      transparent 1px,
      transparent 3px
    );
  mix-blend-mode: multiply;
}
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9001;
  background:
    radial-gradient(ellipse at center, transparent 50%, rgba(0,0,0,0.6) 100%),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence baseFrequency='0.9' numOctaves='2'/></filter><rect width='100%25' height='100%25' filter='url(%23n)' opacity='0.35'/></svg>");
  opacity: 0.22;
  mix-blend-mode: overlay;
}

/* Custom cursor */
.cursor, .cursor-trail {
  position: fixed;
  top: 0; left: 0;
  pointer-events: none;
  z-index: 10000;
  transform: translate(-50%, -50%);
}
.cursor {
  width: 28px;
  height: 28px;
  color: var(--lavender);
  mix-blend-mode: difference;
}
.cursor-trail {
  color: var(--blood);
  opacity: 0.5;
  width: 22px;
  height: 22px;
  transition: transform 0.12s ease-out;
}
.cursor svg, .cursor-trail svg { width: 100%; height: 100%; }

/* Selection */
::selection { background: var(--lavender); color: var(--void); }

/* Typography */
h1, h2, h3 { font-family: var(--f-gothic); font-weight: 300; letter-spacing: 0.01em; line-height: 1.02; }
h1 { font-size: clamp(60px, 11vw, 180px); }
h2 { font-size: clamp(40px, 7vw, 92px); }
h3 { font-size: clamp(28px, 4vw, 48px); }

/* Latin-only blackletter helper */
.fraktur { font-family: var(--f-fraktur); }

.mono { font-family: var(--f-mono); font-size: 12px; letter-spacing: 0.15em; text-transform: uppercase; }
.serif { font-family: var(--f-serif); }

a { color: inherit; text-decoration: none; }

/* Glitch text */
.glitch {
  position: relative;
  display: inline-block;
}
.glitch::before, .glitch::after {
  content: attr(data-text);
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  overflow: hidden;
}
.glitch::before {
  color: var(--blood);
  animation: glitch-1 3.5s infinite steps(1);
  clip-path: polygon(0 0, 100% 0, 100% 33%, 0 33%);
  transform: translate(-2px, 0);
}
.glitch::after {
  color: var(--lavender);
  animation: glitch-2 2.8s infinite steps(1);
  clip-path: polygon(0 66%, 100% 66%, 100% 100%, 0 100%);
  transform: translate(2px, 0);
}
@keyframes glitch-1 {
  0%, 90%, 100% { transform: translate(-2px, 0); }
  92% { transform: translate(-6px, 1px); }
  94% { transform: translate(4px, -1px); }
  96% { transform: translate(-3px, 2px); }
}
@keyframes glitch-2 {
  0%, 85%, 100% { transform: translate(2px, 0); }
  87% { transform: translate(5px, -2px); }
  89% { transform: translate(-4px, 1px); }
  91% { transform: translate(3px, 2px); }
}

/* Screens */
.screen {
  min-height: 100vh;
  width: 100%;
  position: relative;
  padding: 60px 40px;
}

.screen-hidden { display: none; }

/* Buttons */
.btn {
  background: transparent;
  color: var(--bone);
  border: 1px solid var(--lavender-dim);
  padding: 16px 28px;
  font-family: var(--f-mono);
  font-size: 12px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  cursor: none;
  position: relative;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 12px;
}
.btn::before {
  content: '\271F\FE0E';
  font-family: var(--f-serif);
  font-size: 14px;
  color: var(--lavender);
}
.btn:hover {
  background: var(--lavender);
  color: var(--void);
  border-color: var(--lavender);
}
.btn:hover::before { color: var(--void); }
.btn.blood { border-color: var(--blood); }
.btn.blood::before { color: var(--blood); }
.btn.blood:hover { background: var(--blood); color: var(--white); border-color: var(--blood); }
.btn.blood:hover::before { color: var(--white); }

/* Progress bar */
.progress {
  width: 100%;
  height: 3px;
  background: rgba(255,255,255,0.06);
  position: relative;
  overflow: hidden;
}
.progress-fill {
  position: absolute;
  top: 0; left: 0; bottom: 0;
  background: linear-gradient(90deg, var(--blood), var(--lavender));
  transition: width 0.4s cubic-bezier(.7,0,.2,1);
}

/* Top chrome */
.chrome {
  position: fixed;
  top: 0; left: 0; right: 0;
  padding: 16px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 100;
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--ash);
  pointer-events: none;
  mix-blend-mode: difference;
}
.chrome > * { pointer-events: auto; }
.chrome .rec::before {
  content: '●';
  color: var(--blood);
  margin-right: 6px;
  animation: blink 1.2s infinite;
}
@keyframes blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0.2; }
}

/* Utility */
.cross {
  color: var(--lavender);
  font-family: var(--f-serif);
  display: inline-block;
}
.floating-cross {
  position: absolute;
  color: var(--purple-mid);
  font-family: var(--f-serif);
  font-size: 14px;
  opacity: 0.4;
  pointer-events: none;
  user-select: none;
}

.divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--lavender-dim), transparent);
  margin: 40px 0;
}

/* Hide scrollbar during tests */
.lock-scroll { overflow: hidden; height: 100vh; }

/* ==== MOBILE ==== */
@media (hover: none) and (pointer: coarse) {
  /* Touch devices: no custom cursor, revert default */
  html, body { cursor: auto; }
  .cursor, .cursor-trail { display: none !important; }
  .btn, a, button, span[onClick] { cursor: pointer; }
}

@media (max-width: 768px) {
  html, body { font-size: 16px; }

  h1 { font-size: clamp(44px, 13vw, 84px); }
  h2 { font-size: clamp(30px, 9vw, 56px); }
  h3 { font-size: clamp(22px, 6vw, 38px); }

  .screen { padding: 72px 16px 48px !important; }

  .chrome {
    padding: 8px 10px !important;
    font-size: 9px !important;
    letter-spacing: 0.1em !important;
    flex-direction: column !important;
    align-items: stretch !important;
    row-gap: 2px;
    background: linear-gradient(180deg, rgba(7,5,12,0.85), rgba(7,5,12,0) 100%);
    mix-blend-mode: normal !important;
  }
  .chrome > div {
    display: flex !important;
    justify-content: space-between !important;
    gap: 8px !important;
    width: 100%;
  }
  .chrome > div > span {
    margin-left: 0 !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .btn {
    padding: 14px 18px;
    font-size: 11px;
    letter-spacing: 0.18em;
  }

  .divider { margin: 24px 0; }
}

@media (max-width: 480px) {
  h1 { font-size: clamp(40px, 14vw, 64px); }
  h2 { font-size: clamp(26px, 9vw, 44px); }
  .chrome { font-size: 8px !important; letter-spacing: 0.06em !important; }
  .btn { padding: 12px 14px; font-size: 10px; letter-spacing: 0.14em; }

  /* Hide the long process name on very narrow screens */
  .chrome > div:first-child > span:not(.rec) { display: none; }
}

@media (max-width: 768px) {
  .intro-side-mark { display: none !important; }
}
