:root {
  --ink: #050505;
  --paper: #f7f3eb;
  --red: #ff2a1b;
}

* { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; background: #000; }

body {
  overflow: hidden;
  color: var(--paper);
  font-family: Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif;
}

button { font: inherit; }

.experience {
  position: relative;
  width: 100vw;
  height: 100svh;
  min-height: 620px;
  isolation: isolate;
  overflow: hidden;
  background: #000;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.world-canvas, .grain {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.world-canvas { z-index: -3; transition: filter .9s ease; }

.grain {
  z-index: 7;
  pointer-events: none;
  opacity: .16;
  mix-blend-mode: screen;
  background-image:
    repeating-radial-gradient(circle at 17% 32%, transparent 0 1px, rgba(255,255,255,.1) 1px 2px, transparent 2px 4px);
  background-size: 7px 7px;
  animation: grain .2s steps(2) infinite;
}

.scene {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  perspective: 1200px;
}

.cat {
  position: relative;
  width: 440px;
  height: 600px;
  transform: translateY(4vh);
  filter: drop-shadow(0 35px 30px rgba(0,0,0,.65));
  transition: filter .7s ease, transform .7s cubic-bezier(.2,.8,.2,1);
}

.cat-shadow {
  position: absolute;
  left: 50%;
  bottom: 2%;
  width: min(520px, 80vw);
  height: 90px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: rgba(0,0,0,.75);
  filter: blur(25px);
}

.body {
  position: absolute;
  left: 85px;
  bottom: -85px;
  width: 290px;
  height: 390px;
  border-radius: 48% 52% 15% 15% / 30% 30% 10% 10%;
  background: radial-gradient(circle at 38% 12%, #fff 0 10%, #eee9df 40%, #bcb8af 100%);
  box-shadow: inset -24px -10px 35px rgba(58,48,38,.22), inset 18px 10px 24px rgba(255,255,255,.8);
}

.tail {
  position: absolute;
  right: -45px;
  bottom: 0;
  width: 220px;
  height: 82px;
  border: 38px solid #d7d3ca;
  border-left: 0;
  border-radius: 0 80px 80px 0;
  transform: rotate(-19deg);
}

.head {
  position: absolute;
  left: 48px;
  top: 62px;
  width: 350px;
  height: 315px;
  z-index: 3;
  border-radius: 48% 48% 43% 43% / 46% 46% 54% 54%;
  background:
    radial-gradient(ellipse at 28% 30%, #fff 0 20%, transparent 42%),
    linear-gradient(135deg, #fff 0%, #f2eee7 48%, #bbb7ae 100%);
  box-shadow:
    inset -25px -16px 32px rgba(70,60,50,.2),
    inset 12px 8px 18px rgba(255,255,255,.95),
    0 12px 18px rgba(0,0,0,.2);
}

.ear {
  position: absolute;
  top: 32px;
  width: 132px;
  height: 175px;
  z-index: 1;
  overflow: hidden;
  background: linear-gradient(135deg, #fbfaf6, #c7c3bb);
  clip-path: polygon(50% 0, 100% 100%, 0 82%);
}

.ear i {
  position: absolute;
  inset: 34px 26px 22px;
  background: linear-gradient(#c69a95, #e9c5bd);
  clip-path: polygon(50% 0, 100% 100%, 0 82%);
  opacity: .72;
}

.ear-left { left: 43px; transform: rotate(-14deg); }
.ear-right { right: 33px; transform: rotate(16deg) scaleX(-1); }

.fur {
  position: absolute;
  top: -5px;
  width: 70px;
  height: 52px;
  background: #f7f4ed;
  clip-path: polygon(0 75%, 25% 10%, 48% 70%, 67% 0, 100% 90%);
}
.fur-one { left: 116px; }
.fur-two { left: 166px; transform: scale(.8) rotate(8deg); }

.eye {
  position: absolute;
  top: 92px;
  width: 82px;
  height: 72px;
  overflow: hidden;
  border: 5px solid #292720;
  border-radius: 48% 52% 44% 56%;
  background: #e8d77c;
  box-shadow: inset 0 6px 9px rgba(48,34,13,.42), 0 3px 0 rgba(255,255,255,.65);
  transition: all .6s cubic-bezier(.2,1.2,.2,1);
}

.eye-left { left: 70px; transform: rotate(3deg); }
.eye-right { right: 70px; transform: rotate(-3deg); }

.iris {
  position: absolute;
  left: 20px;
  top: 13px;
  width: 36px;
  height: 43px;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 36%, #ffe76d 0 8%, #a97d15 35%, #332006 72%);
  transition: transform .08s linear, opacity .25s ease;
}

.pupil {
  position: absolute;
  left: 14px;
  top: 3px;
  width: 9px;
  height: 37px;
  border-radius: 50%;
  background: #050505;
}

.glint {
  position: absolute;
  left: 8px;
  top: 7px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: white;
}

.brow {
  position: absolute;
  top: 67px;
  z-index: 4;
  width: 100px;
  height: 22px;
  border-top: 12px solid #5f5b52;
  border-radius: 50%;
  transition: transform .55s cubic-bezier(.2,1.4,.2,1), top .55s ease;
}

.brow-left { left: 52px; transform: rotate(18deg); }
.brow-right { right: 52px; transform: rotate(-18deg); }

.muzzle {
  position: absolute;
  top: 175px;
  width: 105px;
  height: 80px;
  border-radius: 50%;
  background: rgba(255,255,255,.78);
  box-shadow: inset 0 -9px 12px rgba(130,120,105,.08);
}
.muzzle-left { left: 76px; }
.muzzle-right { right: 76px; }

.nose {
  position: absolute;
  left: 154px;
  top: 175px;
  z-index: 2;
  width: 43px;
  height: 30px;
  border-radius: 55% 55% 68% 68%;
  background: linear-gradient(#584741, #1c1817);
  clip-path: polygon(0 20%, 100% 20%, 52% 100%);
}

.mouth {
  position: absolute;
  left: 138px;
  top: 205px;
  width: 75px;
  height: 32px;
  border-bottom: 6px solid #39332e;
  border-radius: 50%;
  transition: all .55s ease;
}

.whiskers {
  position: absolute;
  top: 196px;
  width: 130px;
  height: 82px;
}
.whiskers-left { left: -53px; }
.whiskers-right { right: -53px; transform: scaleX(-1); }
.whiskers i {
  position: absolute;
  left: 8px;
  width: 123px;
  height: 2px;
  transform-origin: right;
  background: linear-gradient(90deg, transparent, #d9d4ca);
}
.whiskers i:nth-child(1) { top: 17px; transform: rotate(10deg); }
.whiskers i:nth-child(2) { top: 37px; transform: rotate(0); }
.whiskers i:nth-child(3) { top: 57px; transform: rotate(-11deg); }

.arm {
  position: absolute;
  left: 148px;
  top: 340px;
  z-index: 5;
  width: 165px;
  height: 250px;
  border-radius: 48% 48% 42% 42%;
  background: linear-gradient(95deg, #c7c2b8 0, #fff 46%, #d6d1c8 100%);
  box-shadow: inset -14px 0 22px rgba(40,35,28,.18), 0 18px 20px rgba(0,0,0,.3);
  transform-origin: 50% 0;
  transform: perspective(500px) rotateX(-24deg) scale(1.08);
}

.paw {
  position: absolute;
  left: -19px;
  bottom: -34px;
  width: 204px;
  height: 126px;
  border-radius: 50% 50% 43% 43%;
  background: radial-gradient(circle at 44% 25%, #fff 0 25%, #dbd6cc 68%, #aaa59c 100%);
  box-shadow: inset -12px -9px 20px rgba(62,53,42,.2), 0 18px 20px rgba(0,0,0,.38);
  transform: scale(1.2);
}

.toe {
  position: absolute;
  top: 28px;
  width: 2px;
  height: 48px;
  background: rgba(105,95,84,.22);
}
.toe-one { left: 52px; transform: rotate(-8deg); }
.toe-two { left: 100px; }
.toe-three { right: 52px; transform: rotate(8deg); }

.coal-button {
  position: absolute;
  left: 50%;
  top: 62.5%;
  z-index: 8;
  width: 226px;
  height: 226px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: transparent;
  cursor: pointer;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

.tablet {
  position: absolute;
  inset: 0;
  display: block;
  overflow: hidden;
  border: 5px solid #0a0a0a;
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 27%, rgba(255,255,255,.18), transparent 8%),
    radial-gradient(circle at 42% 36%, #343434 0, #151515 28%, #020202 72%);
  box-shadow:
    inset 18px 22px 22px rgba(255,255,255,.07),
    inset -20px -24px 30px #000,
    0 18px 18px rgba(0,0,0,.62),
    0 0 0 2px rgba(255,255,255,.08);
  transition: transform .35s cubic-bezier(.2,1.8,.2,1), box-shadow .35s ease;
}

.tablet i {
  position: absolute;
  width: 8px;
  height: 5px;
  border-radius: 50%;
  background: #4b4b4b;
  opacity: .6;
}
.tablet i:nth-child(1) { left: 62px; top: 75px; }
.tablet i:nth-child(2) { right: 55px; top: 115px; transform: scale(1.5); }
.tablet i:nth-child(3) { left: 102px; bottom: 38px; }

.activate-label {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 30px);
  z-index: 10;
  padding: 8px 13px 6px;
  border: 4px solid #fff;
  color: var(--red);
  background: #050505;
  font-size: clamp(30px, 4vw, 66px);
  line-height: .9;
  letter-spacing: .035em;
  white-space: nowrap;
  opacity: 0;
  transform: translate(-50%, 18px) rotate(-2deg) scale(.75);
  transition: opacity .18s ease, transform .28s cubic-bezier(.18,1.4,.2,1);
  text-shadow: 3px 3px 0 #720c05;
  pointer-events: none;
}

.coal-button.show-label .activate-label {
  opacity: 1;
  transform: translate(-50%, 0) rotate(-2deg) scale(1);
}

.coal-button:hover .tablet,
.coal-button:focus-visible .tablet,
.coal-button.touch-hover .tablet {
  transform: scale(1.06);
  box-shadow: inset 18px 22px 22px rgba(255,255,255,.08), inset -20px -24px 30px #000, 0 20px 24px rgba(0,0,0,.65), 0 0 0 8px var(--red);
}

.coal-button:active .tablet { transform: scale(.95); }

.hint {
  position: absolute;
  left: 50%;
  bottom: 2.8%;
  z-index: 6;
  margin: 0;
  transform: translateX(-50%);
  color: rgba(255,255,255,.68);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 11 px;
  font-weight: 800;
  letter-spacing: .28em;
  text-align: center;
  white-space: nowrap;
}

.spiral {
  position: absolute;
  inset: -10%;
  display: none;
  border-radius: 50%;
  background: repeating-radial-gradient(circle at center, #fff 0 3px, #ff00ae 4px 8px, #401bff 9px 13px, #00ffcb 14px 18px);
  animation: spin .7s linear infinite;
}
.spiral::after {
  content: "";
  position: absolute;
  inset: 14%;
  border-radius: 50%;
  background: repeating-conic-gradient(from 0deg, transparent 0 14deg, rgba(0,0,0,.6) 15deg 26deg);
}
.spiral-alt { animation-direction: reverse; filter: hue-rotate(120deg); }

.activated .world-canvas { filter: saturate(1.45) contrast(1.13); }
.activated .grain { opacity: .3; mix-blend-mode: overlay; }
.activated .cat {
  transform: translateY(4vh) scale(1.035);
  filter: drop-shadow(0 0 20px rgba(0,255,231,.55)) drop-shadow(0 0 46px rgba(255,0,178,.42));
}
.activated .eye {
  top: 74px;
  width: 100px;
  height: 110px;
  border-width: 7px;
  border-radius: 50%;
  background: white;
}
.activated .eye-left { left: 52px; transform: rotate(-2deg); }
.activated .eye-right { right: 52px; transform: rotate(2deg); }
.activated .iris { opacity: 0; }
.activated .spiral { display: block; }
.activated .brow { top: 46px; }
.activated .brow-left { transform: rotate(-11deg); }
.activated .brow-right { transform: rotate(11deg); }
.activated .mouth {
  left: 152px;
  top: 223px;
  width: 48px;
  height: 54px;
  border: 5px solid #39332e;
  border-radius: 50%;
  background: #4c2b32;
}
.activated .tablet {
  animation: pill-trip 1.1s ease-in-out infinite alternate;
  box-shadow: inset 18px 22px 22px rgba(255,255,255,.08), inset -20px -24px 30px #000, 0 0 15px #00fff0, 0 0 35px #ff00a8;
}
.activated .activate-label {
  color: #fff;
  border-color: #00ffd5;
  background: #ec006e;
  text-shadow: 3px 3px 0 #3917b8;
}

@keyframes spin { to { transform: rotate(360deg) scale(1.08); filter: hue-rotate(360deg); } }
@keyframes pill-trip {
  from { transform: rotate(-2deg) scale(1); }
  to { transform: rotate(3deg) scale(1.07); }
}
@keyframes grain {
  0% { transform: translate(0,0); }
  25% { transform: translate(2px,-1px); }
  50% { transform: translate(-1px,2px); }
  75% { transform: translate(1px,1px); }
}

@media (max-width: 620px) {
  .experience { min-height: 560px; }
  .cat { transform: translateY(2vh) scale(.75); }
  .activated .cat { transform: translateY(2vh) scale(.78); }
  .coal-button { top: 62%; width: 170px; height: 170px; }
  .activate-label { bottom: calc(100% + 22px); font-size: clamp(27px, 10vw, 44px); }
  .hint { bottom: 2.5%; max-width: 92vw; white-space: normal; line-height: 1.5; }
}

@media (max-height: 720px) and (min-width: 621px) {
  .cat { transform: translateY(3vh) scale(.82); }
  .activated .cat { transform: translateY(3vh) scale(.85); }
  .coal-button { top: 63%; width: 185px; height: 185px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
}
