/* ============================================================
   DOGHOUSE — hand-built, left on all night.
   ============================================================ */

/* the crew's own fonts (free personal-use versions) */
@font-face {
  font-family: "Monster Rocker";
  src: url("fonts/monster-rocker.otf") format("opentype");
  font-display: block;
}
@font-face {
  font-family: "Frightmare";
  src: url("fonts/frightmare.otf") format("opentype");
  font-display: swap;
}
@font-face {
  font-family: "Storm Gust";
  src: url("fonts/storm-gust.ttf") format("truetype");
  font-display: swap;
}

:root {
  --bg: #0b0a0a;          /* matte black */
  --bg-raise: #121010;
  --ink: #ddd6c8;         /* worn off-white */
  --ink-dim: #928b80;
  --edge: #3b3533;
  --red: #8e1216;         /* deep red */
  --red-hi: #b51a1f;
  --folder: #171413;
  --folder-front: #1e1a19;
  --tape-yellow: #e2b60f;

  --font-mark: "Monster Rocker", Impact, "Arial Narrow", sans-serif;   /* DOGHOUSE */
  --font-head: "Frightmare", Impact, "Arial Narrow", sans-serif;       /* headings + labels */
  --font-brush: "Storm Gust", Impact, "Arial Narrow", sans-serif;      /* links, tape */
  --font-type: "Special Elite", "Courier New", Courier, monospace;     /* typed text */

  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html { background: var(--bg); }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  background: transparent;
  color: var(--ink);
  font-family: var(--font-type);
  font-size: 17px;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

/* the background picture, darkened so the text still reads.
   A fixed layer (not background-attachment) so it also holds still on phones. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 120% 90% at 40% 30%, rgba(8, 7, 7, .35) 0%, rgba(8, 7, 7, .7) 100%),
    linear-gradient(rgba(8, 7, 7, .35), rgba(8, 7, 7, .35)),
    url("icons/background.jpg") center / cover no-repeat,
    var(--bg);
}

body.is-intro { overflow: hidden; }

/* links, tape and labels in Storm Gust: its free version has broken
   letter-pair glyphs, so ligatures stay off */
.discord,
.social,
.tape-track span,
.channel-name {
  font-variant-ligatures: none;
  font-feature-settings: "liga" 0, "clig" 0, "dlig" 0, "calt" 0;
}

img { max-width: 100%; }

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

:focus { outline: none; }
:focus-visible {
  outline: 2px dashed var(--red-hi);
  outline-offset: 5px;
}

/* ---------- TV static + scanlines over everything ---------- */

.static {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 50;
  pointer-events: none;
  opacity: .07;
  mix-blend-mode: screen;
  image-rendering: pixelated;
  transition: opacity .2s linear;
}

.scanlines {
  position: fixed;
  inset: 0;
  z-index: 51;
  pointer-events: none;
  background: repeating-linear-gradient(
    180deg,
    rgba(0, 0, 0, 0) 0,
    rgba(0, 0, 0, 0) 2px,
    rgba(0, 0, 0, .26) 3px,
    rgba(0, 0, 0, 0) 4px
  );
  box-shadow: inset 0 0 16vmax rgba(0, 0, 0, .75);
  transition: opacity .2s linear;
}

/* slow rolling bar, like a bad signal */
.scanlines::after {
  content: "";
  position: absolute;
  left: 0; right: 0;
  top: -24vh;
  height: 20vh;
  background: linear-gradient(180deg, transparent, rgba(221, 214, 200, .035), transparent);
  animation: roll 9s linear infinite;
}

@keyframes roll { to { transform: translateY(150vh); } }

/* the very first moment: nothing at all */
body.is-blank .static,
body.is-blank .scanlines,
body.is-blank .intro-tape { opacity: 0; }

/* ---------- Wordmark ---------- */

.wordmark {
  margin: 0;
  font-family: var(--font-mark);
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0;
  color: var(--ink);
  text-shadow: .035em .03em 0 var(--red);
  display: flex;
  align-items: baseline;
  white-space: nowrap;
  transform: rotate(-2deg);
  user-select: none;
  -webkit-user-select: none;
}

.ltr {
  display: inline-block;
  font-size: calc(var(--s, 1) * 1em);
  margin-right: .018em;
  transform: translate(var(--x, 0), var(--y, 0)) rotate(var(--r, 0deg));
  transform-origin: var(--o, 50% 100%);
}

/* idle motion: every letter sways on its own clock */
.wordmark.is-alive .ltr {
  animation: bob var(--dur, 2.4s) ease-in-out var(--dl, 0s) infinite alternate;
}

@keyframes bob {
  to {
    transform:
      translate(var(--x, 0), calc(var(--y, 0em) - var(--bob, .04em)))
      rotate(calc(var(--r, 0deg) + var(--wig, 2deg)));
  }
}

/* the red misprint shadow jumps around like a bad signal */
.wordmark.is-alive { animation: misprint 2.6s steps(1, end) infinite; }

@keyframes misprint {
  0%   { text-shadow: .035em .03em 0 var(--red); }
  22%  { text-shadow: -.03em .02em 0 var(--red); }
  24%  { text-shadow: .06em -.01em 0 var(--red); }
  27%  { text-shadow: .035em .03em 0 var(--red); }
  63%  { text-shadow: .02em .05em 0 var(--red); }
  65%  { text-shadow: .035em .03em 0 var(--red); }
  88%  { text-shadow: -.045em -.01em 0 var(--red-hi); }
  89%  { text-shadow: .035em .03em 0 var(--red); }
}

@media (hover: hover) {
  html:not(.reduce-motion) .wordmark--home .ltr:hover { animation: jiggle .36s steps(3, end); }
}

@keyframes jiggle {
  0%, 100% { transform: translate(var(--x), var(--y)) rotate(var(--r)); }
  33% { transform: translate(var(--x), calc(var(--y) - .07em)) rotate(calc(var(--r) - 8deg)); }
  66% { transform: translate(var(--x), var(--y)) rotate(calc(var(--r) + 6deg)); }
}

/* ---------- Opening screen ---------- */

.intro {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(36px, 8vh, 72px);
  padding: 16px;
  overflow: hidden;
  background:
    linear-gradient(rgba(8, 7, 7, .72), rgba(8, 7, 7, .72)),
    url("icons/background.jpg") center / cover no-repeat,
    var(--bg);
}

/* the very first moment stays pure black */
body.is-blank .intro { background: #000; }

.intro[hidden] { display: none; }

.wordmark--intro {
  position: relative;
  z-index: 2;
  font-size: clamp(2.6rem, 15vw, 11rem);
  justify-content: center;
  margin-left: -2vw;
}

.js .wordmark--intro .ltr { opacity: 0; }
.js .wordmark--intro.is-settled .ltr { opacity: 1; }

.intro-tape {
  position: absolute;
  z-index: 1;
  pointer-events: none;
  transition: opacity .25s linear;
  animation: sway 8s ease-in-out infinite;
}

.intro-tape--a { --rot: -13deg; top: -3vh; left: -9vw; width: clamp(260px, 44vw, 660px); }
.intro-tape--b { --rot: 10deg; bottom: -4vh; right: -10vw; width: clamp(280px, 46vw, 700px); animation-delay: -3s; }

@keyframes sway {
  0%, 100% { transform: rotate(var(--rot, 0deg)) translateY(0); }
  50% { transform: rotate(calc(var(--rot, 0deg) + 1.6deg)) translateY(7px); }
}

.open-btn {
  position: relative;
  z-index: 2;
  font-family: var(--font-head);
  font-size: 1.15rem;
  letter-spacing: .04em;
  color: var(--ink);
  background: var(--red);
  border: 0;
  border-radius: 0;
  padding: 12px 20px 11px;
  min-height: 44px;
  margin-left: 9vw;
  cursor: pointer;
  transform: rotate(1.5deg);
  box-shadow: 4px 4px 0 #000;
}

.open-btn[hidden] { display: none; }
.open-btn:hover { background: var(--red-hi); }
.open-btn:active { transform: rotate(1.5deg) translate(2px, 2px); box-shadow: 2px 2px 0 #000; }

/* app sits hidden behind the intro until opened */
.js body.is-intro .app { visibility: hidden; }

/* ---------- Sound control ---------- */

.sound {
  position: fixed;
  right: max(14px, env(safe-area-inset-right));
  bottom: max(14px, env(safe-area-inset-bottom));
  z-index: 30;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 9px 14px 8px;
  font-family: var(--font-type);
  font-size: .9rem;
  color: var(--ink);
  background: rgba(11, 10, 10, .9);
  border: 1.5px solid var(--edge);
  border-radius: 0;
  cursor: pointer;
  transform: rotate(-1deg);
}

.sound:hover { border-color: var(--ink-dim); }

.sound-dot {
  width: 9px;
  height: 9px;
  background: var(--red-hi);
  flex: none;
}

.sound[aria-pressed="false"] .sound-dot {
  background: transparent;
  box-shadow: inset 0 0 0 1.5px var(--ink-dim);
}

.no-js .sound { display: none; }

/* ---------- Views ---------- */

.view {
  --pad-x: clamp(16px, 5vw, 72px);
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  padding: clamp(18px, 3vw, 34px) var(--pad-x) 190px;
  overflow-x: clip;
}

.view[hidden] { display: none; }

[data-focus]:focus { outline: none; }

.topnav { position: relative; z-index: 7; display: flex; }

.nav-btn {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 9px 18px 8px;
  margin-left: 3vw;
  font-family: var(--font-head);
  font-size: 1.2rem;
  letter-spacing: .03em;
  color: var(--ink);
  text-decoration: none;
  background: var(--bg);
  border: 1.5px solid var(--ink-dim);
  transform: rotate(-1.5deg);
  transition: background-color .12s, color .12s, border-color .12s;
}

.nav-btn:hover {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--bg);
}

/* ---------- Caution tape ---------- */

.tape-wrap {
  position: relative;
  z-index: 5;
  height: 70px;
  margin: 26px calc(-1 * var(--pad-x));
  pointer-events: none;
}

.tape {
  position: absolute;
  left: -15vw;
  right: -15vw;
  top: 50%;
  height: 42px;
  margin-top: -21px;
  display: flex;
  align-items: center;
  overflow: hidden;
  color: #141010;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .22), rgba(255, 255, 255, 0) 38%, rgba(0, 0, 0, .16)),
    var(--tape-color, var(--tape-yellow));
  border-top: 2px solid rgba(0, 0, 0, .22);
  border-bottom: 2px solid rgba(0, 0, 0, .35);
  box-shadow: 0 9px 18px rgba(0, 0, 0, .55);
  transform: rotate(var(--tilt, -2deg));
}

.tape--red { --tape-color: var(--red); color: #0a0808; }

/* each strip hangs at its own angle */
.tilt-1 { --tilt: -2.5deg; }
.tilt-2 { --tilt: 2deg; }
.tilt-3 { --tilt: 1.8deg; }
.tilt-4 { --tilt: -2deg; }

/* grime */
.tape::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--noise, none);
  background-size: 128px 128px;
  mix-blend-mode: multiply;
  opacity: .22;
}

.tape-track {
  display: flex;
  flex: none;
  white-space: nowrap;
  animation: tape-move 70s linear infinite;
}

.tape--rev .tape-track { animation-direction: reverse; }

.tape-track span {
  font-family: var(--font-brush);
  font-size: 25px;
  line-height: 1;
  letter-spacing: .12em;
  padding: 0 1.1em;
}

@keyframes tape-move { to { transform: translateX(-50%); } }

/* the photo-tape clusters in the corners */
.corner-tape {
  position: absolute;
  z-index: 1;
  pointer-events: none;
  animation: sway 9s ease-in-out infinite;
}

.corner-tape--tr { --rot: 15deg; top: -24px; right: -80px; width: clamp(220px, 30vw, 440px); }
.corner-tape--bl { --rot: -9deg; bottom: 6px; left: -90px; width: clamp(240px, 34vw, 480px); animation-delay: -4s; }

/* ---------- Old TVs ---------- */

.tv {
  position: relative;
  width: min(100%, var(--tv-w, 600px));
  margin-top: 64px;           /* room for the antenna */
  transform: rotate(var(--tv-tilt, 0deg));
}

.tv-antenna {
  position: absolute;
  left: 50%;
  top: -16px;
  width: 46px;
  height: 18px;
  margin-left: -23px;
  background: #1d1918;
  border: 1.5px solid var(--edge);
  border-bottom: 0;
  border-radius: 24px 24px 0 0;
}

.tv-antenna::before,
.tv-antenna::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 10px;
  width: 2px;
  height: 66px;
  margin-left: -1px;
  background: linear-gradient(180deg, #9a9187, #3b3533);
  transform-origin: 50% 100%;
  animation: antenna-l 5s ease-in-out infinite;
}

.tv-antenna::after { animation-name: antenna-r; animation-duration: 6.3s; height: 58px; }

@keyframes antenna-l { 0%, 100% { transform: rotate(-30deg); } 50% { transform: rotate(-24deg); } }
@keyframes antenna-r { 0%, 100% { transform: rotate(26deg); } 50% { transform: rotate(33deg); } }

.tv-body {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 52px;
  gap: 16px;
  padding: 18px;
  background: linear-gradient(165deg, #2a2422 0%, #1a1615 55%, #0f0c0c 100%);
  border: 1.5px solid var(--edge);
  border-radius: 16px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .07),
    inset 0 -4px 0 rgba(0, 0, 0, .5),
    12px 14px 0 rgba(0, 0, 0, .55);
}

/* little feet */
.tv-body::after {
  content: "";
  position: absolute;
  left: 12%;
  right: 12%;
  bottom: -12px;
  height: 12px;
  background: linear-gradient(90deg, #120f0e 0 12%, transparent 12% 88%, #120f0e 88%);
}

.tv-screen {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  min-height: 200px;
  border-radius: 30px / 24px;
  background: radial-gradient(ellipse 90% 80% at 50% 45%, #1c1a19 0%, #0d0c0c 75%);
  border: 3px solid #0a0808;
  box-shadow:
    0 0 0 2px #3a3331,
    0 0 0 7px #151211,
    inset 0 0 50px rgba(0, 0, 0, .85);
}

.tv-content {
  position: relative;
  z-index: 1;
  height: 100%;
  padding: clamp(24px, 4vw, 44px) clamp(20px, 4vw, 44px);
  text-shadow: 0 0 7px rgba(221, 214, 200, .3);
  animation: crt-flicker 5.5s steps(1, end) infinite;
}

@keyframes crt-flicker {
  0%   { opacity: 1;   transform: translateX(0); }
  38%  { opacity: .9; }
  39%  { opacity: 1; }
  71%  { transform: translateX(2px); }
  72%  { transform: translateX(-1px); }
  73%  { transform: translateX(0); }
  91%  { opacity: .94; }
  92%  { opacity: 1; }
}

/* moving static on the screen */
.tv-static {
  position: absolute;
  inset: -64px;
  z-index: 2;
  pointer-events: none;
  background-image: var(--noise, none);
  background-size: 128px 128px;
  mix-blend-mode: screen;
  opacity: .1;
  animation: tv-noise .42s steps(1, end) infinite;
}

@keyframes tv-noise {
  0%   { transform: translate(0, 0); }
  17%  { transform: translate(-31px, 17px); }
  33%  { transform: translate(23px, -41px); }
  50%  { transform: translate(-47px, -9px); }
  67%  { transform: translate(11px, 37px); }
  83%  { transform: translate(43px, -23px); }
}

.tv-glass {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  border-radius: inherit;
  background:
    linear-gradient(125deg, rgba(255, 255, 255, .08) 0%, rgba(255, 255, 255, 0) 30%),
    repeating-linear-gradient(180deg, rgba(0, 0, 0, 0) 0 2px, rgba(0, 0, 0, .32) 2px 3px),
    radial-gradient(ellipse at 50% 50%, transparent 55%, rgba(0, 0, 0, .6) 100%);
}

/* the refresh bar rolling down the tube */
.tv-glass::after {
  content: "";
  position: absolute;
  left: 0; right: 0;
  top: -30%;
  height: 30%;
  background: linear-gradient(180deg, transparent, rgba(221, 214, 200, .06), transparent);
  animation: tv-roll 4.5s linear infinite;
}

@keyframes tv-roll { to { transform: translateY(450%); } }

.tv-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding-top: 6px;
}

.knob {
  position: relative;
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #4a423f, #191514 70%);
  border: 2px solid #0b0909;
  box-shadow: 2px 3px 0 rgba(0, 0, 0, .5);
}

.knob::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 3px;
  width: 3px;
  height: 12px;
  margin-left: -1.5px;
  background: var(--ink-dim);
  transform-origin: 50% 13px;
  transform: rotate(var(--k, 35deg));
  transition: transform .25s cubic-bezier(.3, 1.6, .5, 1);
}

.knob--sm { width: 26px; height: 26px; --k: -60deg; }
.knob--sm::after { height: 8px; top: 2px; transform-origin: 50% 9px; }

.grille {
  flex: none;
  width: 36px;
  height: 64px;
  border-radius: 3px;
  background: repeating-linear-gradient(180deg, #0b0909 0 3px, #2a2422 3px 6px);
}

.led {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--red-hi);
  box-shadow: 0 0 8px 2px rgba(181, 26, 31, .7);
  animation: led 3.1s steps(1, end) infinite;
}

@keyframes led { 0%, 100% { opacity: 1; } 47% { opacity: .35; } 49% { opacity: 1; } }

/* ---------- Home ---------- */

.mark-row {
  position: relative;
  margin: clamp(56px, 12vh, 130px) 0 0;
}

.wordmark--home {
  position: relative;
  z-index: 3;
  font-size: clamp(3.3rem, 12vw, 10.5rem);
  margin-left: 6vw;
}

.tvs {
  display: flex;
  flex-direction: column;
  gap: 40px;
  margin-top: 30px;
}

.tv--links { --tv-w: 600px; --tv-tilt: -1.5deg; margin-left: clamp(0px, 4vw, 90px); }
.tv--about { --tv-w: 540px; --tv-tilt: 1.8deg; align-self: flex-end; margin-right: clamp(0px, 4vw, 110px); }

@media (min-width: 1080px) {
  .tvs {
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
    gap: 48px;
  }
  .tv--links { width: auto; flex: 0 1 600px; }
  .tv--about { width: auto; flex: 0 1 520px; align-self: flex-start; margin-top: 170px; }
}

.links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.link--yt { margin: 34px 0 0 30%; transform: rotate(-1.2deg); }
.link--tt { margin: 6px 0 0 54%; transform: rotate(1.8deg); }

.arrow {
  font-family: var(--font-type);
  font-size: .45em;
  margin-left: .3em;
  opacity: .8;
}

.discord {
  display: inline-flex;
  align-items: baseline;
  font-family: var(--font-brush);
  font-size: clamp(2.5rem, 6.5vw, 4.8rem);
  line-height: 1;
  color: var(--ink);
  background: var(--red);
  text-decoration: none;
  padding: .17em .45em .13em;
  transform: rotate(1.4deg);
  box-shadow: 9px 9px 0 -1.5px #0d0c0c, 9px 9px 0 0 var(--ink-dim);
  transition: transform .12s ease-out, background-color .12s, box-shadow .12s;
}

.discord:hover {
  background: var(--red-hi);
  transform: rotate(.6deg) translate(-3px, -3px);
  box-shadow: 12px 12px 0 -1.5px #0d0c0c, 12px 12px 0 0 var(--ink);
}

.discord:active {
  transform: rotate(1.4deg) translate(3px, 3px);
  box-shadow: 4px 4px 0 -1.5px #0d0c0c, 4px 4px 0 0 var(--ink-dim);
}

.social {
  display: inline-flex;
  align-items: baseline;
  min-height: 44px;
  padding: 8px 4px 2px;
  font-family: var(--font-brush);
  font-size: 1.9rem;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 2px solid var(--red);
  transition: background-color .12s, border-color .12s, color .12s;
}

.social .arrow { font-size: .7em; }

.social:hover {
  color: #fff;
  background: rgba(142, 18, 22, .22);
  border-bottom-color: var(--red-hi);
}

.about h2 {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 16px;
  font-family: var(--font-head);
  font-weight: 400;
  font-size: clamp(1.7rem, 3.4vw, 2.3rem);
  letter-spacing: .02em;
  line-height: 1;
  transform: rotate(-1deg);
}

.about h2::before {
  content: "";
  width: .4em;
  height: .4em;
  background: var(--red-hi);
  flex: none;
}

/* ---------- Typed text + cursor ---------- */

.typed {
  margin: 0;
  font-size: clamp(1.02rem, 1.5vw, 1.15rem);
  line-height: 1.75;
}

.about .typed { min-height: 7em; }

.typed-out { white-space: pre-line; }

.cursor {
  display: inline-block;
  width: .5em;
  height: 1em;
  margin-left: 2px;
  vertical-align: -.16em;
  background: var(--red-hi);
  animation: blink 1.05s steps(1, end) infinite;
}

.typed.is-typing .cursor { animation: none; }

@keyframes blink { 50% { opacity: 0; } }

/* ---------- Icons ---------- */

.deco {
  position: absolute;
  z-index: 6;
  height: auto;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
  filter: drop-shadow(5px 8px 0 rgba(0, 0, 0, .5));
}

/* eye next to the wordmark: looks around, blinks */
.deco--eye {
  z-index: 4;
  width: clamp(64px, 8vw, 118px);
  right: clamp(4px, 9vw, 190px);
  top: 4%;
  animation: eye 7s ease-in-out infinite;
}

@keyframes eye {
  0%, 100% { transform: translate(0, 0) rotate(0deg) scale(1, 1); }
  18%  { transform: translate(-6px, 3px) rotate(-12deg) scale(1, 1); }
  40%  { transform: translate(5px, -3px) rotate(9deg) scale(1, 1); }
  57%  { transform: translate(5px, -3px) rotate(9deg) scale(1, 1); }
  59%  { transform: translate(5px, -3px) rotate(9deg) scale(1, .06); }
  61%  { transform: translate(5px, -3px) rotate(9deg) scale(1, 1); }
  80%  { transform: translate(-2px, 1px) rotate(-4deg) scale(1, 1); }
}

/* scissors snipping at the tape */
.deco--scissors {
  width: clamp(84px, 9vw, 130px);
  right: 12%;
  top: -10px;
  animation: snip 2.4s ease-in-out infinite;
}

@keyframes snip {
  0%, 45%, 100% { transform: rotate(-6deg); }
  10% { transform: rotate(-20deg) translateX(-4px); }
  20% { transform: rotate(-4deg); }
  30% { transform: rotate(-18deg) translateX(-8px); }
}

/* syringe floating off the corner of the links TV */
.deco--syringe {
  width: clamp(120px, 14vw, 180px);
  right: -7%;
  bottom: -58px;
  animation: drift 5s ease-in-out infinite;
}

@keyframes drift {
  0%, 100% { transform: rotate(-14deg) translateY(0); }
  50% { transform: rotate(-6deg) translateY(-10px); }
}

/* a hand reaching out from behind the about TV */
.deco--hand {
  z-index: -1;
  width: clamp(130px, 15vw, 210px);
  right: -15%;
  bottom: -40px;
  animation: reach 4.2s ease-in-out infinite;
}

@keyframes reach {
  0%, 100% { transform: rotate(14deg) translate(0, 0); }
  50% { transform: rotate(24deg) translate(8px, -16px); }
}

.deco--pills {
  width: clamp(64px, 7vw, 96px);
  right: -18px;
  top: -40px;
  animation: rattle 3.4s ease-in-out infinite;
}

@keyframes rattle {
  0%, 100% { transform: rotate(0deg) translateY(0); }
  40% { transform: rotate(10deg) translateY(-6px); }
  44% { transform: rotate(6deg) translateY(-4px); }
  48% { transform: rotate(11deg) translateY(-6px); }
}

/* mask + "don't look at me" under the bottom tape */
.haunt {
  position: relative;
  z-index: 2;
  height: clamp(220px, 26vw, 320px);
  pointer-events: none;
}

.deco--mask {
  width: clamp(84px, 9vw, 130px);
  right: clamp(200px, 34vw, 560px);
  top: 18px;
  animation: mask-float 7s ease-in-out infinite;
}

@keyframes mask-float {
  0%, 100% { transform: translateY(0) rotate(-5deg); opacity: .92; }
  45% { transform: translateY(-12px) rotate(3deg); opacity: 1; }
  60% { transform: translateY(-8px) rotate(3deg) scale(1.02); }
  62% { transform: translateY(-8px) rotate(-2deg) scale(1.02); }
  64% { transform: translateY(-8px) rotate(3deg) scale(1.02); }
}

.deco--dontlook {
  width: clamp(190px, 26vw, 380px);
  right: clamp(0px, 7vw, 140px);
  top: 26%;
  filter: drop-shadow(0 0 10px rgba(181, 26, 31, .35));
  animation: scrawl 4.2s steps(1, end) infinite;
}

/* flickers like a dying sign */
@keyframes scrawl {
  0%   { opacity: 1;   transform: translate(0, 0) rotate(-3deg); }
  11%  { opacity: .25; }
  12%  { opacity: 1; }
  40%  { transform: translate(3px, -1px) rotate(-3deg); }
  41%  { transform: translate(0, 0) rotate(-3deg); }
  68%  { opacity: .55; }
  69%  { opacity: 1; }
  70%  { opacity: .15; }
  72%  { opacity: 1; }
  90%  { transform: translate(-2px, 1px) rotate(-2.5deg); }
  91%  { transform: translate(0, 0) rotate(-3deg); }
}

/* axe stuck in the tape, wobbling like it just landed */
.deco--axe {
  z-index: 6;
  width: clamp(120px, 13vw, 190px);
  left: 12%;
  top: -18px;
  transform-origin: 72% 30%;
  animation: thunk 5.5s ease-out infinite;
}

@keyframes thunk {
  0%, 84%, 100% { transform: rotate(62deg); }
  86% { transform: rotate(70deg); }
  89% { transform: rotate(57deg); }
  92% { transform: rotate(65deg); }
  95% { transform: rotate(60deg); }
  98% { transform: rotate(63deg); }
}

/* something in the static when nobody's folder is open */
.channel-ghost {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 34%;
  margin: -24% 0 0 -17%;
  opacity: 0;
  filter: contrast(1.2) blur(.4px);
  animation: ghost 7.5s steps(1, end) infinite;
}

.tv--channel.has-signal .channel-ghost { display: none; }

@keyframes ghost {
  0%   { opacity: 0; }
  58%  { opacity: .3; }
  59%  { opacity: 0; }
  61%  { opacity: .5; transform: translateX(-3px); }
  64%  { opacity: .45; transform: translateX(2px); }
  67%  { opacity: 0; transform: none; }
}

/* ---------- Members ---------- */

.members-title {
  margin: clamp(44px, 10vh, 110px) 0 0 6vw;
  font-family: var(--font-head);
  font-weight: 400;
  font-size: clamp(2.6rem, 8vw, 5.6rem);
  line-height: 1;
  text-shadow: .035em .03em 0 var(--red);
  transform: rotate(-2deg);
  transform-origin: left bottom;
}

.members-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 40px;
  margin-top: 10px;
}

.members-side {
  position: relative;
  order: -1;
  width: min(100%, 400px);
  margin: 0 3vw 0 auto;
  padding-top: 8px;
}

@media (min-width: 1100px) {
  .members-layout {
    grid-template-columns: minmax(0, 1fr) clamp(270px, 24vw, 360px);
    align-items: start;
  }
  .members-side {
    order: 2;
    width: auto;
    margin: 0;
    position: sticky;
    top: 40px;
  }
}

.tv--channel { --tv-w: 100%; --tv-tilt: 2deg; }

.tv--channel .tv-screen { min-height: 0; aspect-ratio: 4 / 3; }

.channel { position: absolute; inset: 0; padding: 0; }

.channel-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  filter: grayscale(.35) contrast(1.1) brightness(.9);
}

.channel-name {
  position: absolute;
  left: 14px;
  bottom: 12px;
  padding: 3px 9px 1px;
  font-family: var(--font-brush);
  font-size: 1.3rem;
  line-height: 1.1;
  color: var(--ink);
  background: rgba(11, 10, 10, .65);
  opacity: 0;
}

.tv--channel .tv-static { opacity: .62; }
.tv--channel.has-signal .channel-img,
.tv--channel.has-signal .channel-name { opacity: 1; }
.tv--channel.has-signal .tv-static { opacity: .12; }
.tv--channel.is-switching .tv-static { opacity: .95; }

.deco--eye-side { width: 78px; top: -34px; left: -26px; right: auto; z-index: 7; }
.deco--pills-side { top: auto; right: -14px; bottom: -44px; }

.deco--hand-members {
  z-index: 1;
  right: 10vw;
  bottom: 40px;
  width: clamp(120px, 13vw, 190px);
}

.folders {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 340px));
  column-gap: clamp(36px, 7vw, 110px);
  row-gap: clamp(60px, 10vh, 100px);
  align-items: start;
  margin: 30px 0 0 clamp(0px, 5vw, 100px);
}

.folder { position: relative; transform: rotate(var(--tilt, 0deg)); }

.folder:nth-child(1) { --tilt: -1.2deg; --px: 7%; }
.folder:nth-child(2) { --tilt: 1.6deg;  --px: 44%; margin-top: 80px; }
.folder:nth-child(3) { --tilt: .7deg;   --px: 22%; margin-left: 3vw; }
.folder:nth-child(4) { --tilt: -1.8deg; --px: 50%; margin-top: 34px; }

.folder-tab {
  position: relative;
  z-index: 2;
  display: flex;
  margin: 0 0 -1.5px 16px;
  font: inherit;
}

.folder:nth-child(2) .folder-tab,
.folder:nth-child(4) .folder-tab { margin-left: 46%; }

.folder-name {
  display: block;
  min-height: 44px;
  padding: 12px 18px 11px;
  font-family: var(--font-head);
  font-weight: 400;
  font-size: 1.55rem;
  line-height: 1;
  letter-spacing: .03em;
  white-space: nowrap;
  color: var(--ink);
  background: var(--folder);
  border: 1.5px solid var(--edge);
  border-bottom: 0;
  border-radius: 0;
  cursor: pointer;
  transform: translateY(0);
  transition:
    transform .2s cubic-bezier(.34, 1.8, .5, 1),
    background-color .14s,
    border-color .14s;
}

.folder-name:hover { transform: translateY(-3px); border-color: var(--ink-dim); }

.sleeve {
  position: relative;
  height: 212px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .02), transparent 40%),
    var(--folder);
  border: 1.5px solid var(--edge);
  cursor: pointer;
  transition: border-color .14s;
}

.photo {
  position: absolute;
  left: min(var(--px, 7%), calc(100% - 172px));
  top: 18px;
  width: 150px;
  height: 150px;
  padding: 5px;
  background: var(--ink);
  box-shadow: 3px 5px 0 rgba(0, 0, 0, .55);
  transform: rotate(-3deg);
  transition: transform .3s cubic-bezier(.2, .9, .3, 1.3);
}

.folder:nth-child(even) .photo { transform: rotate(2.5deg); }

.photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* a bit of tape */
.photo::before {
  content: "";
  position: absolute;
  top: -9px;
  left: 50%;
  width: 56px;
  height: 18px;
  margin-left: -28px;
  background: rgba(221, 214, 200, .3);
  transform: rotate(4deg);
}

/* the front of the folder */
.flap {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 52px;
  background: var(--folder-front);
  border-top: 1.5px solid var(--edge);
  transform-origin: 50% 100%;
  transition: transform .34s cubic-bezier(.2, .8, .2, 1), background-color .2s;
}

.flap::after {
  content: "";
  position: absolute;
  right: 20px;
  top: 14px;
  width: 74px;
  height: 1.5px;
  background: var(--edge);
  box-shadow: 0 9px 0 var(--edge), -22px 18px 0 var(--edge);
}

/* drawer: the sheet that slides out */
.drawer {
  display: grid;
  grid-template-rows: 0fr;
  visibility: hidden;
  transition:
    grid-template-rows .34s cubic-bezier(.2, .8, .2, 1),
    visibility 0s linear .34s;
}

.drawer-clip { min-height: 0; overflow: hidden; }

.sheet {
  margin: 0 14px 0 26px;
  padding: 16px 20px 20px;
  background:
    repeating-linear-gradient(180deg, transparent 0 calc(1.75em - 1px), rgba(221, 214, 200, .06) calc(1.75em - 1px) 1.75em) 0 16px,
    var(--bg-raise);
  border: 1.5px solid var(--red);
  border-top: 0;
}

.sheet .typed { min-height: 3.5em; }

/* open */
.folder.is-open .folder-name {
  background: var(--red);
  border-color: var(--red-hi);
  transform: translateY(-9px) rotate(-1.5deg);
}

.folder.is-open .sleeve { border-color: var(--red); }

.folder.is-open .flap {
  transform: perspective(420px) rotateX(-62deg);
  background: #241c1b;
}

.folder.is-open .flap::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 3px;
  background: var(--red-hi);
}

.folder.is-open .photo { transform: translateY(-7px) rotate(-1deg); }

.folder.is-open .drawer {
  grid-template-rows: 1fr;
  visibility: visible;
  transition:
    grid-template-rows .34s cubic-bezier(.2, .8, .2, 1),
    visibility 0s;
}

/* ---------- Small screens ---------- */

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

  .mark-row { margin-top: 70px; }
  .wordmark--home { font-size: 16.5vw; margin-left: 2vw; }
  .deco--eye { width: 58px; top: -60px; right: 14px; }

  .tv--links, .tv--about { margin-left: 0; margin-right: 0; }
  .tv--about { align-self: stretch; }

  .deco--syringe { width: 118px; right: -10px; bottom: -56px; }
  .deco--hand { width: 120px; right: -34px; bottom: -40px; }
  .deco--pills { width: 62px; right: -6px; top: -36px; }
  .deco--scissors { width: 78px; right: 6%; }

  .corner-tape--tr { right: -90px; top: -30px; }
  .corner-tape--bl { left: -100px; }

  .members-title { margin-left: 2vw; }

  .folders {
    grid-template-columns: minmax(0, 350px);
    row-gap: 56px;
    margin-left: 0;
  }

  .folder:nth-child(n) { margin-top: 0; margin-left: 0; }
  .folder:nth-child(even) { margin-left: clamp(0px, 7vw, 40px); }

  .sleeve { height: 188px; }
  .photo { width: 132px; height: 132px; left: min(var(--px, 7%), calc(100% - 152px)); }

  .members-side { margin: -6px 2px 0 auto; width: min(64%, 250px); }
  .tv--channel .tv-body { padding: 10px; gap: 8px; }
  .tv--channel .tv-panel { gap: 8px; }
  .tv--channel .grille { display: none; }
  .tv--channel .tv-screen { border-radius: 18px / 14px; }
  .channel-name { font-size: 1rem; left: 8px; bottom: 8px; }
  .deco--eye-side { width: 56px; top: -24px; left: -34px; }
  .deco--hand-members { right: 4vw; width: 110px; }
}

@media (max-width: 560px) {
  .tv-body {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    padding: 12px;
  }
  .tv-panel {
    flex-direction: row;
    justify-content: flex-end;
    padding: 0 4px;
    gap: 12px;
  }
  .knob { width: 26px; height: 26px; }
  .knob::after { height: 8px; top: 2px; transform-origin: 50% 9px; }
  .knob--sm { width: 20px; height: 20px; }
  .knob--sm::after { height: 6px; top: 2px; transform-origin: 50% 6px; }
  .grille { width: 64px; height: 18px; background: repeating-linear-gradient(90deg, #0b0909 0 3px, #2a2422 3px 6px); }
  .tv-screen { border-radius: 22px / 18px; min-height: 180px; }
  .link--yt { margin-left: 22%; }
  .link--tt { margin-left: 44%; }
}

/* ---------- ?motion=reduce (testing) ---------- */

.reduce-motion *,
.reduce-motion *::before,
.reduce-motion *::after {
  animation: none !important;
  transition: none !important;
}

/* ---------- No JavaScript: just show everything ---------- */

@media (prefers-reduced-motion: reduce) {
  .no-js .scanlines::after { animation: none; display: none; }
  .no-js .cursor { animation: none; }
}

.no-js body { overflow: auto; }
.no-js .intro { display: none; }
.no-js .view[hidden] { display: block; }
.no-js .typed .sr-only {
  position: static !important;
  width: auto; height: auto;
  margin: 0;
  overflow: visible;
  clip: auto;
  clip-path: none;
  white-space: normal;
}
.no-js .typed-out,
.no-js .cursor { display: none; }
.no-js .drawer { grid-template-rows: 1fr; visibility: visible; }
