@font-face {
  font-family: Pixelify;
  src: url('assets/pixelify.ttf') format('truetype');
  font-display: swap;
  font-weight: 400 700;
}

:root {
  color-scheme: dark;
  --cream: #ead8d0;
  --muted: #bb9fa1;
  --pink: #ffd4cf;
  --rim: #744650;
  font: 16px 'Courier New', monospace;
  color: var(--cream);
  background: #120c0e;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  min-height: 100svh;
  background: linear-gradient(140deg, #4317221a, #0d070a80 70%), url('assets/dust.png') #160d10;
  background-blend-mode: normal, soft-light;
}

.shell { width: min(620px, 100% - 28px); margin-inline: auto; padding: clamp(32px, 10vh, 96px) 0 44px; }

.masthead {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 18px;
  padding: 10px 15px 16px;
  background: linear-gradient(#421c24, #2a1218);
  border: 2px ridge var(--rim);
  box-shadow: 3px 3px #090609;
}

.masthead img { display: block; width: 100px; height: auto; }
.masthead h1 {
  position: relative;
  margin: 0;
  color: var(--pink);
  font: 600 clamp(1.2rem, 4vw, 1.75rem)/1.05 Pixelify, monospace;
  text-shadow: 2px 2px #301114;
}

.title-drips { position: absolute; inset: 0; pointer-events: none; }
.title-drips i {
  --length: 12px;
  --delay: 0s;
  position: absolute;
  top: 81%;
  left: 13%;
  width: 3px;
  height: var(--length);
  border-radius: 1px 1px 4px 4px;
  background: linear-gradient(#a13340, #711522 70%, #981f32);
  box-shadow: 1px 1px #2d0c13;
  animation: title-bleed 4.8s var(--delay) ease-in infinite;
}
.title-drips i:nth-child(2) { left: 34%; --length: 17px; --delay: -1.4s; }
.title-drips i:nth-child(3) { left: 59%; --length: 8px; --delay: -3.2s; }
.title-drips i:nth-child(4) { left: 91%; --length: 15px; --delay: -2.1s; }

@keyframes title-bleed {
  0%, 10% { height: 3px; opacity: .78; }
  67%, 83% { height: var(--length); opacity: 1; }
  100% { height: var(--length); opacity: .12; }
}

@media (prefers-reduced-motion: reduce) {
  .title-drips i { animation: none; }
}

.sound-test {
  position: relative;
  isolation: isolate;
  display: grid;
  justify-items: center;
  align-content: center;
  margin-top: 15px;
  min-height: 142px;
  padding: 20px 12px;
  border: 2px inset #67454c;
  background: #1c1316;
}

.sound-test::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    repeating-linear-gradient(0deg, #95616d24 0 1px, transparent 1px 5px),
    linear-gradient(0deg, transparent 25%, #9b53621d 52%, transparent 78%);
  background-size: 100% 5px, 100% 55px;
  mask-image: radial-gradient(ellipse at center, #0009 10%, #000 59%, #0006 100%);
  animation: sound-ripple 20s linear infinite;
}

@keyframes sound-ripple {
  from { background-position: 0 0, 0 0; }
  to { background-position: 0 5px, 0 55px; }
}

@media (prefers-reduced-motion: reduce) {
  .sound-test::before { animation: none; }
}

.sound-test-button {
  min-width: 168px;
  min-height: 44px;
  padding: 3px 10px;
  border: 3px outset #a5a5a5;
  border-radius: 0;
  background: #c6c6c6;
  color: #191919;
  font: bold 1rem Arial, sans-serif;
  cursor: pointer;
}

.sound-test-button:hover { background: #dbdbdb; }
.sound-test-button:active { border-style: inset; }
#sound-status { margin: 10px 0 0; color: var(--pink); font-size: .875rem; }

.directory {
  margin-top: 15px;
  border: 2px inset #67454c;
  background: #201418;
  box-shadow: 3px 3px #090609;
}

.directory h2 {
  margin: 0;
  padding: 7px 11px;
  background: #57232d;
  font: bold 1.1rem Times New Roman, serif;
}

.page-trim { display: block; margin-inline: auto; max-width: 100%; pointer-events: none; }
.page-trim img {
  display: block;
  max-width: 100%;
  height: auto;
  mask-image: linear-gradient(to right, transparent, #000 8%, #000 92%, transparent);
}
.page-trim-skulls { width: 372px; margin-top: 8px; }
.page-trim-skulls + .directory { margin-top: 7px; }
.page-trim-rings { width: 128px; margin-top: 12px; }

.entry { border-top: 1px solid #52343b; scroll-margin-top: 12px; }

.entry summary {
  display: flex;
  align-items: center;
  gap: 6px 10px;
  min-height: 43px;
  padding: 7px 11px;
  cursor: pointer;
  list-style: none;
  background: #291b20;
}

.entry summary::-webkit-details-marker { display: none; }
.entry summary::before { content: '▸'; color: #ec958b; }
.entry[open] summary::before { content: '▾'; }
.entry summary:hover { background: #3a2229; }
.filename { overflow-wrap: anywhere; text-decoration: underline; color: var(--pink); }
.kind { margin-left: auto; font-size: .8rem; color: var(--muted); }

.new-mark {
  margin-left: auto;
  padding: 2px 4px;
  color: #fff0db;
  border: 1px dashed #e28478;
  background: #682332;
  font: bold .8rem/1 Pixelify, monospace;
}

.preview { display: grid; justify-items: start; gap: 10px; padding: 10px 11px 12px; }
.preview img { display: block; width: min(100%, 440px); height: auto; border: 1px solid var(--rim); }
.preview audio { width: min(100%, 315px); height: 38px; }
.preview a { color: var(--pink); }
.preview a:visited { color: #d6a6b7; }

.postcards {
  display: grid;
  width: 100%;
  grid-template-columns: repeat(2, minmax(0, 288px));
  gap: 8px;
}
.postcards img { width: 100%; height: auto; }
.postcards a:hover img { border-color: #ffc0ae; }

@media (max-width: 480px) {
  .postcards { grid-template-columns: minmax(0, 288px); }
}

.cursor-demos {
  display: grid;
  gap: 5px;
  width: 100%;
  max-width: 315px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.cursor-demo {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  color: var(--muted);
  border: 1px dashed var(--rim);
  cursor: var(--cur), var(--cursor-image) var(--hotspot, 3) 2, default;
}
.cursor-demo img { width: 32px; flex: 0 0 32px; border: 0; }
.cursor-original { --cur: url('assets/obychniy.cur'); --cursor-image: url('assets/obychniy-preview.png'); }
.cursor-red { --cur: url('assets/krasniy.cur'); --cursor-image: url('assets/krasniy-preview.png'); }
.cursor-reversed { --cur: url('assets/nazad.cur'); --cursor-image: url('assets/nazad-preview.png'); --hotspot: 28; }

.button-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.old-button {
  display: inline-grid;
  width: 88px;
  height: 31px;
  padding: 0 2px;
  place-content: center;
  border: 2px outset #8c6870;
  border-radius: 0;
  color: #f3dfd8;
  background: linear-gradient(#4e3940, #271922);
  text-align: center;
  font: 600 .78rem/.83 Pixelify, monospace;
  text-decoration: none;
  cursor: pointer;
}
.old-button.channel { color: #ffd3cf; background: linear-gradient(#682b38, #2c1118); }
.old-button:hover { filter: brightness(1.2); }
.old-button:active { border-style: inset; }
:focus-visible { outline: 1px dashed #ffada5; outline-offset: 2px; }

@media (pointer: fine) {
  :root, .entry summary, a, .old-button, .sound-test-button {
    cursor: url('assets/krasnaya_strelka.cur'), url('assets/krasnaya_strelka.png') 2 1, auto;
  }
}

@media (max-width: 380px) {
  .masthead { padding-inline: 10px; gap: 4px 10px; }
  .masthead img { width: 76px; }
  .directory { margin-top: 12px; }
}
