/* quietkittyson : analog-horror link hub
   z-scale: static 1 / scanlines 2 / vignette 3 / osd 5 / content 10 */

:root {
  --void: #060607;
  --dead: #0e0e10;
  --pale: #dcd9d2;
  --pale-dim: rgba(220, 217, 210, 0.62);
  --gray: #8b8b90;
  --line: rgba(220, 217, 210, 0.13);
  --blood: #c2170f;
  --blood-lite: #ff3b2f;
  --ab-r: rgba(255, 0, 51, 0.5);
  --ab-c: rgba(0, 229, 255, 0.35);
  --font-d: 'Unbounded', sans-serif;
  --font-m: 'PT Mono', monospace;
  color-scheme: dark;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--void);
  color: var(--pale);
  font-family: var(--font-m);
  font-size: 16px;
  line-height: 1.55;
  overflow-x: hidden;
}

::selection { background: rgba(194, 23, 15, 0.55); color: #fff; }

.skip {
  position: absolute;
  top: -60px;
  left: 16px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--dead);
  color: var(--pale);
  border: 1px solid var(--line);
  text-decoration: none;
  font-size: 0.9rem;
  transition: top 0.2s;
}
.skip:focus-visible { top: 16px; }

/* ---------- vhs layers ---------- */

#static {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
  opacity: 0.055;
  image-rendering: pixelated;
  transition: opacity 0.25s;
}
body.burst #static { opacity: 0.14; }

.scanlines {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0 2px,
    rgba(0, 0, 0, 0.22) 2px 4px
  );
}

.vignette {
  position: fixed;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background: radial-gradient(ellipse 115% 95% at 50% 45%, transparent 55%, rgba(0, 0, 0, 0.62) 100%);
}

.osd {
  position: fixed;
  z-index: 5;
  pointer-events: none;
  font-family: var(--font-m);
  font-size: 0.82rem;
  letter-spacing: 0.14em;
  color: var(--pale-dim);
  display: flex;
  align-items: center;
  gap: 8px;
}
.osd-rec { top: 18px; left: 20px; }
.osd-rec i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--blood-lite);
  animation: blink 1.6s steps(1) infinite;
}
.osd-tc { bottom: 16px; left: 20px; }

@keyframes blink { 0%, 60% { opacity: 1; } 61%, 100% { opacity: 0.15; } }

main, .foot { position: relative; z-index: 10; }

/* ---------- jumpscare ---------- */

#scare {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 70;
  background: #020202;
  display: none;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  pointer-events: none;
}
body.scare-on #scare {
  display: flex;
  background: #020202 url('scare.jpg?v=4') 50% 30% / cover no-repeat;
  animation: scare-shake 0.055s steps(2) infinite;
}

#scare .ph {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
body.scare-on #scare .ph-main { animation: lunge 1.15s linear forwards; }
@keyframes lunge {
  from { transform: scale(1); }
  to { transform: scale(1.28); }
}
#scare .ph-a, #scare .ph-b { opacity: 0; }
body.scare-on #scare .ph-a {
  opacity: 0.92;
  clip-path: inset(14% 0 66% 0);
  animation: slice-jump-a 0.13s steps(2) infinite;
}
body.scare-on #scare .ph-b {
  opacity: 0.92;
  clip-path: inset(68% 0 8% 0);
  animation: slice-jump-b 0.17s steps(2) infinite;
}
@keyframes slice-jump-a {
  0% { transform: translateX(-18px); }
  100% { transform: translateX(9px); }
}
@keyframes slice-jump-b {
  0% { transform: translateX(14px); }
  100% { transform: translateX(-11px); }
}
#scare::after {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.16;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}
@keyframes scare-shake {
  0% { transform: translate(-14px, 7px); }
  100% { transform: translate(12px, -9px); }
}

/* ---------- hero ---------- */

.hero {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4.5rem 1.2rem 2.5rem;
  text-align: center;
}

.gname {
  font-family: var(--font-d);
  font-weight: 900;
  font-size: clamp(2.6rem, 11vw, 7.2rem);
  line-height: 1.02;
  letter-spacing: 0.01em;
  color: var(--pale);
  text-shadow: -2px 0 var(--ab-r), 2px 0 var(--ab-c);
  position: relative;
}
.gline { display: block; }

.handle {
  margin-top: 1.1rem;
  font-size: 0.98rem;
  letter-spacing: 0.3em;
  margin-left: 0.3em;
  color: var(--gray);
}

/* glitch tick: brief slice jumps on the name */
@keyframes slice-a {
  0% { clip-path: inset(12% 0 76% 0); transform: translateX(-7px); }
  50% { clip-path: inset(58% 0 22% 0); transform: translateX(6px); }
  100% { clip-path: inset(30% 0 54% 0); transform: translateX(-4px); }
}
html:not(.no-js) body.tick .gname::after,
html:not(.no-js) body.burst .gname::after {
  content: attr(data-t);
  position: absolute;
  inset: 0;
  white-space: pre-line;
  color: var(--pale);
  text-shadow: -4px 0 var(--ab-r), 4px 0 var(--ab-c);
  animation: slice-a 0.14s steps(2) 2;
}
body.burst .gname { animation: shudder 0.12s steps(2) 5; }
@keyframes shudder {
  0% { transform: translate(-3px, 1px); }
  100% { transform: translate(3px, -1px); }
}

/* ---------- cat ---------- */

.cat-btn {
  margin-top: clamp(1.6rem, 4.5vh, 3rem);
  background: none;
  border: 0;
  cursor: pointer;
  color: inherit;
  font-family: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  -webkit-tap-highlight-color: transparent;
}
.cat-btn:focus-visible { outline: 1px solid var(--pale); outline-offset: 8px; }

.cat {
  width: clamp(210px, 32vh, 300px);
  display: block;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
.cat .fur {
  fill: #0c0c0e;
  stroke: rgba(220, 217, 210, 0.2);
  stroke-width: 2;
  stroke-linejoin: round;
}
.cat .inner-ear { fill: rgba(194, 23, 15, 0.24); }
.cat .rim {
  fill: none;
  stroke: rgba(122, 142, 210, 0.16);
  stroke-width: 5;
  stroke-linecap: round;
}
.cat .fur-line {
  fill: none;
  stroke: rgba(220, 217, 210, 0.12);
  stroke-width: 1.6;
  stroke-linecap: round;
}
.cat .nose { fill: #7c1010; }
.cat .whisker {
  fill: none;
  stroke: rgba(220, 217, 210, 0.3);
  stroke-width: 1.3;
  stroke-linecap: round;
}
.cat .eye { filter: drop-shadow(0 0 6px rgba(255, 59, 47, 0.5)); transition: filter 0.4s; }
.cat .pupil { transition: transform 0.15s ease-out; }
.cat .tail {
  transform-box: view-box;
  transform-origin: 272px 396px;
  animation: tail-sway 3.6s ease-in-out infinite alternate;
}
@keyframes tail-sway {
  from { transform: rotate(-3deg); }
  to { transform: rotate(6deg); }
}
body.burst .cat { transform: rotate(3deg) scale(1.02); }
body.burst .cat .eye { filter: drop-shadow(0 0 14px rgba(255, 59, 47, 0.9)) brightness(1.35); }
body.burst .cat .pupil { transform: scaleY(0.35); }
body.burst .cat .tail { animation: tail-flick 0.3s ease-in-out 3; }
@keyframes tail-flick {
  50% { transform: rotate(16deg); }
}

.pet-label {
  font-size: 0.92rem;
  letter-spacing: 0.12em;
  color: var(--gray);
  transition: color 0.3s;
}
.cat-btn:hover .pet-label, .cat-btn:focus-visible .pet-label { color: var(--blood-lite); }

/* ---------- tracks ---------- */

.tracks {
  max-width: 860px;
  margin: 0 auto;
  padding: clamp(3rem, 8vh, 6rem) clamp(1rem, 4vw, 2rem) clamp(2rem, 5vh, 3.5rem);
  border-top: 1px solid var(--line);
}

.track {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: clamp(1rem, 3vw, 1.8rem);
  padding: clamp(1.3rem, 3vw, 1.9rem) clamp(0.6rem, 2vw, 1.2rem);
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  color: inherit;
  position: relative;
  overflow: hidden;
}
.track::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(194, 23, 15, 0.13), transparent 60%);
  opacity: 0;
  transition: opacity 0.35s;
}
.track:hover::before, .track:focus-visible::before { opacity: 1; }
.track:focus-visible { outline: 1px solid var(--pale); outline-offset: -1px; }

.tnum {
  font-size: 0.88rem;
  color: var(--gray);
  letter-spacing: 0.1em;
}

.ttext { position: relative; display: flex; flex-direction: column; gap: 0.25rem; min-width: 0; }

.ttitle {
  font-family: var(--font-d);
  font-weight: 700;
  font-size: clamp(1.25rem, 3.6vw, 1.9rem);
  line-height: 1.15;
  color: var(--pale);
  position: relative;
  transition: color 0.3s;
}
.track:hover .ttitle, .track:focus-visible .ttitle {
  color: var(--blood-lite);
  text-shadow: -1.5px 0 var(--ab-r), 1.5px 0 var(--ab-c);
}

.tsub {
  font-size: 0.9rem;
  color: var(--gray);
  letter-spacing: 0.06em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tglyph {
  width: 26px;
  height: 26px;
  color: var(--pale-dim);
  opacity: 0.7;
  transition: color 0.3s, opacity 0.3s, transform 0.4s;
}
.track:hover .tglyph, .track:focus-visible .tglyph {
  color: var(--blood-lite);
  opacity: 1;
  transform: translateX(5px);
}

.track--ad .ttitle { color: var(--blood-lite); }
.track--ad .tglyph { color: var(--blood); }

/* ---------- footer ---------- */

.foot {
  max-width: 860px;
  margin: 0 auto;
  padding: 1.6rem clamp(1rem, 4vw, 2rem) 2.4rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  color: var(--gray);
}

/* ---------- reveals ---------- */

html:not(.no-js) .track {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1), color 0.3s;
}
html:not(.no-js) .track.in { opacity: 1; transform: none; }

/* ---------- mobile ---------- */

@media (max-width: 640px) {
  .osd { font-size: 0.72rem; }
  .track { grid-template-columns: auto 1fr auto; }
  .tglyph { width: 22px; height: 22px; }
}

/* ---------- reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .osd-rec i { animation: none; }
  body.tick .gname::after, body.burst .gname::after { animation: none; content: none; }
  body.burst .gname { animation: none; }
  .cat .pupil { transition: none; }
  .cat .tail, body.burst .cat .tail { animation: none; }
  body.burst .cat { transform: none; }
  body.scare-on #scare, body.scare-on #scare .ph-main,
  body.scare-on #scare .ph-a, body.scare-on #scare .ph-b { animation: none; }
  html:not(.no-js) .track { opacity: 1; transform: none; transition: none; }
}
