@font-face {
  font-family: ArchiveSans;
  src: url("media/archive-sans.woff2") format("woff2");
  font-display: swap;
}
@font-face {
  font-family: Bilbo;
  src: url("media/bilbo.ttf") format("truetype");
  font-display: swap;
}
@font-face {
  font-family: "Blood Crow";
  src: url("media/bloodcrow.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}
* { box-sizing: border-box; }
@font-face {
  font-family: "Angels Free";
  src: url("media/Angels Free.ttf") format("truetype");
  font-display: block;
}
[hidden] { display: none !important; }
:root { color-scheme: dark; --paper: #eaeaea; --accent: #ddd; background: #000; }
html { scrollbar-gutter: stable both-edges; }
body { margin: 0; min-height: 100svh; color: var(--paper); background: #000; isolation: isolate; }
button, a { color: inherit; -webkit-tap-highlight-color: transparent; }
button { padding: 0; border: 0; background: none; font: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; }
.scene {
  position: fixed;
  right: 0;
  bottom: 0;
  width: min(100%, 177.778svh);
  aspect-ratio: 16 / 9;
  z-index: -1;
  pointer-events: none;
}
.room {
  position: absolute;
  inset: 0;
  background: #707070 url("media/skulls.jpg") right bottom / cover no-repeat;
  background-blend-mode: multiply;
  filter: grayscale(1) contrast(60);
}
.room::before, .room::after { content: ""; position: absolute; inset: 0; pointer-events: none; }
.room::before { z-index: 1; }
.room::after { z-index: 2; }
.skull-patch { position: absolute; }
.skull-patch::before, .skull-art {
  position: absolute; inset: 0;
  background-image: url("media/skull-silhouettes.png");
  background-size: inherit;
  background-position: inherit;
  background-repeat: no-repeat;
}
.skull-patch::before { content: ""; filter: brightness(0); }
.skull-art { filter: brightness(.4392); }
.skull-highlight { position: absolute; background-image: url("media/skull-highlights.png"); background-repeat: no-repeat; opacity: 0; }
.skull-highlight.lit { opacity: .9; }
#skull-eyes { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; }
.scene.over-skull #skull-eyes { opacity: .9; }
/* The Bayer tile sets a different brightness threshold for each screen pixel. */
.room::before { background: url("media/bayer.png") repeat; background-size: 8px 8px; image-rendering: pixelated; opacity: .46; }
.room::after { background: url("media/grain.gif") repeat; background-size: 210px; mix-blend-mode: soft-light; opacity: .045; }
@media (max-aspect-ratio: 3/4) {
  .scene { width: min(139vw, 68svh); mask-image: linear-gradient(transparent, #000 18%); }
}
body::after { content: ""; position: fixed; inset: 0; z-index: 5; pointer-events: none; background: url("media/grain.gif") repeat; background-size: 210px; mix-blend-mode: soft-light; opacity: .12; }
#entry { position: fixed; inset: 0; z-index: 3; width: 100%; background: #000d; display: grid; align-content: center; justify-items: center; gap: 16px; }
#entry .entry-word, #name, #toggle-links, #links { font-family: "Blood Crow", Georgia, serif; font-weight: 400; }
.entry-word { visibility: hidden; font-size: clamp(52px, 8vw, 88px); letter-spacing: .012em; text-shadow: 1px 3px 4px #000; }
.intro-running .entry-word { visibility: visible; }
.entry-word i { font-style: normal; }
.entry-prompt { min-height: 44px; padding: 8px 18px; opacity: 0; font: 14px Georgia, serif; letter-spacing: .03em; }
.entry-prompt:disabled { pointer-events: none; }
.entry-prompt.ready { opacity: 1; }
.entry-word b { position: relative; display: inline-block; font-weight: inherit; }
main { --height: clamp(165px, 30svh, 300px); display: flex; flex-direction: column; align-items: center; padding: max(42px, calc(42svh - var(--height))) 18px 76px; }
main[inert] { opacity: .55; pointer-events: none; }
main[inert] > * { filter: blur(7px); }
main[inert] > :is(#sound, #paper-corner) { visibility: hidden; }
#entry[inert] { opacity: 0; pointer-events: none; }
.print { display: block; position: relative; height: var(--height); aspect-ratio: 4 / 5; perspective: 900px; transform: rotate(-2deg); touch-action: none; user-select: none; cursor: grab; }
.print.held { z-index: 2; cursor: grabbing; }
.print-inner { display: block; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform .6s cubic-bezier(.22,.7,.25,1); }
#portrait { position: absolute; inset: 0; width: 100%; height: 100%; cursor: inherit; }
.print-inner { pointer-events: none; }
#portrait[aria-pressed="true"] + .print-inner { transform: rotateY(180deg); }
.front, .back { position: absolute; inset: 0; backface-visibility: hidden; border: 1px solid #c2c2c2; box-shadow: 4px 5px 5px #0009; }
.front { background: #101010; }
.mounts { position: absolute; inset: -2px; pointer-events: none;
  background: linear-gradient(135deg,#3b3935 48%,#100f0e 50%,transparent 55%) top left,
    linear-gradient(225deg,#1b1b1b 48%,#555 50%,transparent 55%) top right,
    linear-gradient(45deg,#161616 48%,#444 50%,transparent 55%) bottom left,
    linear-gradient(315deg,#1b1b1b 48%,#444 50%,transparent 55%) bottom right;
  background-size: 15px 15px,12px 12px,12px 12px,12px 12px; background-repeat: no-repeat; }
.mounts::before { content: ""; position: absolute; left: 1px; top: -1px; width: 13px; height: 4px; background: #363432; transform: rotate(-9deg); box-shadow: 0 2px 3px #000b; }
.front::after { content: ""; position: absolute; inset: 7% 0 auto auto; width: 1px; height: 36%; background: linear-gradient(transparent,#fff,transparent); pointer-events: none; }
.signature { position: absolute; bottom: 8%; right: 9%; color: #777267; opacity: .28; font: 22px "Blood Crow",Georgia,serif; transform: rotate(-8deg); }
.signature { font: italic clamp(18px,3.8svh,30px)/1 Bilbo,cursive; opacity: .8; }
#last-skull { position: absolute; bottom: 8%; left: 8%; color: #ffda44; font: 18px Georgia,serif; text-shadow: 0 1px 2px #383325; }
.front img { display: block; width: 100%; height: 100%; object-fit: contain; }
.back {
  display: grid;
  place-content: center;
  padding: 15%;
  transform: rotateY(180deg);
  color: #242424;
  background: linear-gradient(112deg,#eaeaea,#d4d4d4);
  text-align: center;
}
#photo-note { font: clamp(25px,4svh,37px)/1 Bilbo,cursive; text-wrap: balance; }
h1 { display: flex; align-items: center; justify-content: center; gap: clamp(7px,1.5vw,19px); margin: .22em 0 .04em; font-size: clamp(23px,7vw,72px); line-height: 1; }
#name { display: block; position: relative; font-size: 1em; line-height: 1.2; letter-spacing: 0; text-shadow: 0 2px 6px #000c; }
.angel { display: grid; place-items: center; width: 1.12em; height: 1.12em; flex: none; font-size: .73em; color: #d3cfc8; }
.angel:last-child { transform: scaleX(-1); }
.angel::before { content: "A"; font: 1em/1 "Angels Free"; }
#discord { position: fixed; z-index: 4; left: 0; top: 0; width: 25px; height: 25px; object-fit: contain; pointer-events: none; filter: grayscale(1) brightness(1.35) drop-shadow(0 1px 2px #111); }
#feedback { font-family: ArchiveSans, Arial, sans-serif; }
#feedback { height: 19px; font-size: 12px; text-shadow: 0 1px 3px black; }
#feedback.stamped::after { content: "ø" / ""; display: inline-block; margin-left: 6px; border: 1px solid; border-radius: 2px; padding: 0 3px; font: italic 12px Georgia,serif; transform: rotate(-14deg); }
#toggle-links { display: inline-flex; gap: 12px; align-items: center; padding: 7px 17px; min-height: 40px; background: #151515ec; border: 1px solid #777; font-size: 30px; line-height: 1.2; }
#toggle-links span::before { content: "+"; }
#toggle-links[aria-expanded="true"] span::before { content: "−"; }
#links { display: grid; grid-template-columns: minmax(0, 1fr); width: min(250px, 100%); gap: 4px; margin: 11px auto 0; }
#links a { position: relative; display: block; padding: 7px 32px; text-align: center; background: #131313f2; border: 1px solid #666; text-decoration: none; font-size: 30px; line-height: 1.3; }
#links { align-content: start; }
#links.folding { overflow: clip; }
#links a { transform-origin: center top; }
#links a:nth-child(even) { transform-origin: center bottom; }
.link-address { display: block; max-height: 0; overflow: hidden; opacity: 0; color: #c1c1c1; font: 12px/1.5 ArchiveSans,sans-serif; text-overflow: ellipsis; white-space: nowrap; }
#links a:is(:hover,:focus-visible,:active) .link-address { max-height: 2em; opacity: 1; }
#links a::before {
  content: "";
  opacity: 0;
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 23px;
  background: url("media/skull-highlights.png") -164px -28px / 240px 135px no-repeat;
}
#links a:is(:hover, :focus-visible, :active)::before { opacity: 1; }
#links a::after { content: ""; position: absolute; bottom: 4px; left: calc(50% - 13px); width: 26px; height: 1px; background: var(--accent); transform: scaleX(0); }
#links a:is(:hover, :focus-visible) { box-shadow: 2px 3px 3px #0009; }
#links a:is(:hover, :focus-visible, :active)::after { transform: scaleX(1); }
#track-title {
  position: fixed;
  left: max(16px, env(safe-area-inset-left));
  bottom: max(20px, env(safe-area-inset-bottom));
  max-width: calc(100% - 88px);
  padding: 3px 7px;
  font: italic 16px/1.3 Georgia, serif;
  opacity: 0;
  background: #000d;
  pointer-events: none;
}
#next-track { display: block; margin-top: 3px; font: 11px ArchiveSans,sans-serif; color: #ccc; }
#paper-corner { position: fixed; top: 0; right: 0; width: 44px; height: 44px; z-index: 2; }
#paper-corner::before { content: ""; position: absolute; top: 0; right: 0; width: 17px; height: 17px; background: linear-gradient(45deg, transparent 47%,#515151 50%,#171717 70%,#aaa); transform-origin: top right; }
#paper-corner[aria-expanded="true"]::before { transform: scale(2.2); }
#corner-note { position: fixed; top: 17px; right: 42px; padding: 5px 8px; font: italic 14px Georgia,serif; background: #070707ed; }
#idle-word { position: fixed; pointer-events: none; top: 66%; left: 8%; opacity: 0; font: italic 30px Georgia,serif; color: transparent; background: radial-gradient(#ccc .7px,transparent 1px) 0 0 / 3px 3px; background-clip: text; }
#idle-word.visible { opacity: .85; }
#track-title.visible { opacity: 1; }
#sound { position: fixed; right: 12px; bottom: 12px; width: 44px; height: 44px; display: grid; place-content: center; }
#sound span { display: flex; align-items: center; gap: 2px; padding: 7px; background: #101010d9; }
#sound i { display: block; width: 2px; height: 12px; background: var(--paper); transform: scaleY(.18); }
#sound[aria-pressed="true"] i { transform: scaleY(.7); }
@media (prefers-reduced-motion: no-preference) {
  .intro-running .entry-word b::before { content: "o"; position: absolute; inset: 0; animation: intro-o .65s .2s both; }
  .intro-running .entry-word b span { display: inline-block; animation: ink-reveal .65s .2s backwards; }
  .intro-running .entry-word i { animation: word-appear .8s .85s backwards; }
  #profile > .print { transition: filter .45s, translate .65s cubic-bezier(.2,.8,.24,1); }
  #profile > .print.held { transition: none; }
  #profile:not([inert]) .print:is(:hover,.held) { animation-play-state: paused; }
  #profile > h1 { transition: filter .8s; }
  body:not(.entered) .scene { filter: blur(5px); }
  .scene { transition: filter .95s .18s; }
  .skull-art, .skull-highlight { transform: translate(var(--shift-x,0px),var(--shift-y,0px)); transition: transform .18s ease-out, opacity .22s; }
  #skull-eyes,.signature,#idle-word,.link-address { transition: opacity .45s, color .3s, max-height .2s; }
  #paper-corner::before { transition: transform .3s; }
  #profile:not([inert]) .front::after { animation: silver-edge 5.6s ease-in-out infinite alternate; }
  #profile:not([inert]) .print:is(:hover,.held) .front::after { animation-play-state: paused; }
  #links a::before { transition: opacity .24s ease; }
  #track-title { transition: opacity .45s ease; }
  #entry { transition: opacity .65s ease-in-out; }
  #profile { transition: opacity .9s ease-out; }
  #profile:not([inert]) .print { animation: float-photo 5.6s ease-in-out infinite alternate; }
  #links a { transition: translate .15s, box-shadow .15s; }
  #links a:is(:hover, :focus-visible) { translate: 0 -2px; }
  #links a::after { transition: transform .15s; }
  #sound[aria-pressed="true"] i { animation: level .85s ease-in-out infinite alternate; }
  #sound i:nth-child(2) { animation-delay: -.6s; }
  #sound i:nth-child(3) { animation-delay: -.3s; }
  #sound i:nth-child(4) { animation-delay: -.75s; }
}
@keyframes intro-o { from { opacity: 1; } to { opacity: 0; } }
@keyframes ink-reveal { from { clip-path: inset(100% 0 0); } to { clip-path: inset(0); } }
@keyframes word-appear { from { opacity: 0; } }
.entry-word { line-height: 1.1; }
#entry-angel { font-size: 30px; }
#guardian, #angel-home { visibility: hidden; }
#guardian.home, #angel-home.home { visibility: visible; }
#lost-angel { position: fixed; width: 44px; height: 44px; font-size: 22px; opacity: .58; }
#lost-angel:is(:hover,:focus-visible) { opacity: 1; }
main[inert] :is(#darkroom,#lost-angel) { visibility: hidden; }
body:has(#feedback.stamped) .ink-o {
  color: transparent;
  background: linear-gradient(135deg, var(--paper) 45%, #b28aff 47% 53%, var(--paper) 55%);
  background-clip: text;
  text-shadow: none;
}
@media (forced-colors: active) {
  body:has(#feedback.stamped) .ink-o { color: ButtonText; }
}
.photo-echo { position: fixed; z-index: 1; pointer-events: none; object-fit: contain; filter: grayscale(1); transform: rotate(-2deg); }
.back { padding: 21% 9% 19%; }
#photo-note { font-size: clamp(20px,3.8svh,32px); }
.pencil-word { position: relative; display: inline; font: inherit; color: inherit; pointer-events: auto; }
.pencil-word[aria-pressed=false]::after {
  content: ""; position: absolute; inset: 39% -2px auto; height: 20%; transform: rotate(-6deg);
  background: repeating-linear-gradient(175deg, #393534 0 1px, #514c4af2 1px 2px, transparent 2px 3px);
}
#first-visit, #return-visit { position: absolute; left: 7%; }
#first-visit { top: 6%; border: 1px solid #73676b; padding: 2px 4px; color: #64575c; font: 10px/1 monospace; transform: rotate(-4deg); }
#return-visit { top: calc(6% + 20px); font: italic clamp(10px,1.35svh,12px)/1.1 Georgia,serif; color: #514d4d; }
.link-corners { position: absolute; inset: 3px; pointer-events: none; opacity: 0;
  background: linear-gradient(135deg,#d9d3e2 43%,transparent 46%) left top,
    linear-gradient(225deg,#d9d3e2 43%,transparent 46%) right top,
    linear-gradient(45deg,#d9d3e2 43%,transparent 46%) left bottom,
    linear-gradient(315deg,#d9d3e2 43%,transparent 46%) right bottom;
  background-size: 7px 7px; background-repeat: no-repeat;
}
.margin-note { display: none; color: #dacfe3; font: 22px/1 Bilbo,cursive; }
#links a:is(:hover,:focus-visible,:active) .link-corners { opacity: 1; }
#links a:is(:hover,:focus-visible,:active) .margin-note { display: block; }
@media (min-width: 640px) {
  .margin-note { position: absolute; left: calc(100% + 10px); top: 50%; width: max-content; transform: translateY(-50%) rotate(-5deg); text-shadow: 0 1px 3px #000; }
}
#chalk-mark { position: absolute; transform: rotate(-12deg); color: #8e8985; font: italic clamp(12px,1vw,17px)/1 Bilbo,cursive; }
#darkroom { position: fixed; z-index: 2; top: 10px; left: 10px; width: 44px; height: 44px; color: #ba9de1; font: 27px/1 Georgia,serif; }
#darkroom[aria-pressed=true] { color: #ebdcff; }
.darkroom .scene, .darkroom #lost-angel, .darkroom h1 .angel,
.darkroom :is(#idle-word,#paper-corner,#corner-note,#links,#toggle-links) { visibility: hidden; opacity: 0; }
.darkroom #track-title { opacity: 1; }
.darkroom #track-title:has(#current-track:empty) { opacity: 0; }
.darkroom #next-track { display: none; }
@media (prefers-reduced-motion: no-preference) {
  .intro-running .entry-word { animation: dry-ink 1.6s ease-out both; }
  .entered #photo { animation: develop 1.4s ease-out both; }
  .signed .signature { animation: sign .95s .28s ease-out both; }
  .link-corners { transition: opacity .2s; }
  .scene { transition: filter .95s .18s, opacity .55s, visibility 0s; }
  .darkroom .scene { transition: opacity .55s, visibility 0s .55s; }
}
@keyframes dry-ink { 0% { color: #555; text-shadow: 0 2px 4px #aaa8; } 55% { color: #aaa; } 100% { color: var(--paper); text-shadow: 0 1px 1px #111; } }
@keyframes develop { from { filter: grayscale(1) invert(1); } 65% { filter: grayscale(.3) invert(0); } to { filter: none; } }
@keyframes sign { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 -7% 0 0); } }
@keyframes silver-edge { from { opacity: .1; translate: 0 80%; } to { opacity: .95; translate: 0 0; } }
@keyframes float-photo {
  from { transform: translateY(0) rotate(-2deg); }
  to { transform: translateY(-7px) rotate(-.7deg); }
}
@keyframes reveal { from { opacity: 0; transform: translateY(4px); } }
@keyframes level { from { transform: scaleY(.25); } to { transform: scaleY(1); } }
@media (prefers-reduced-motion: reduce) {
  .room::after { display: none; }
  body::after { background-image: url("media/bayer.png"); background-size: auto; opacity: .055; }
  .print-inner { transition: none; }
}
