/* All cut-paper contours share one 320 × 250 drawing table. Only the
   joints move, so coat markings and ink lines travel with the fur. */
.contact-cat-art {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 320 / 250;
  overflow: clip;
  container-type: inline-size;
}
.cat-drawing {
  position: absolute;
  inset: 0 auto auto 0;
  width: 320px;
  height: 250px;
  transform-origin: 0 0;
  transform: scale(tan(atan2(100cqw, 320px)));
  pointer-events: none;
  --typing-phrase: 5.8s;
}
.cat-drawing :where(span, i) {
  display: block;
  position: absolute;
  inset: 0;
}
.cat-shadow {
  background: radial-gradient(
    ellipse 127px 7px at 156px 227px,
    #394a3e30,
    #394a3e13 60%,
    transparent
  );
}
.cat-tail {
  transform-origin: 102px 208px;
}
.tail-ink {
  background: linear-gradient(
    135deg,
    #a4ad7e 2%,
    #647b61 30%,
    #315950 49%,
    #173e40 85%
  );
  clip-path: path(
    "M115 183 C100 200 70 206 51 191 C36 180 38 163 43 149 C47 137 44 131 38 131 C29 131 23 144 20 158 C13 183 27 208 51 218 C74 228 104 222 125 205 Z"
  );
}
.tail-band {
  background: #d3cf9d;
  clip-path: path(
    "M23 148 C28 135 33 130 40 131 C46 132 46 139 44 145 C36 144 29 145 23 148 Z M19 161 Q30 154 40 156 L39 161 Q28 159 18 166 Z"
  );
}
.body-coat {
  background: linear-gradient(
    138deg,
    #a8b28a 11%,
    #698169 41%,
    #3c655b 57%,
    #183f41 83%
  );
  clip-path: path(
    "M116 118 C113 136 89 139 76 156 C60 174 60 196 68 206 L62 205 Q64 213 77 218 C94 225 157 226 179 214 C190 206 197 184 191 161 Q188 140 172 122 Z"
  );
}
.body-flank {
  background: linear-gradient(135deg, #486954, #234c46);
  clip-path: path(
    "M77 156 C63 176 69 190 77 193 C73 176 89 162 95 161 C87 176 89 180 91 183 C100 177 106 177 111 178 C100 185 99 191 97 195 Q120 198 127 216 C109 226 82 222 71 215 Q60 206 66 182 Q68 165 77 156 Z"
  );
}
.body-bib {
  background: linear-gradient(126deg, #f3ead0 34%, #dfdfbd 55%, #91a28a 76%);
  clip-path: path(
    "M105 128 C121 139 151 139 176 122 Q193 143 187 160 L181 154 Q182 166 171 177 L171 169 Q160 186 147 191 L151 180 Q138 187 133 186 C137 173 121 171 119 159 L114 163 Q114 152 108 148 L110 153 Q101 148 98 136 Z"
  );
}
.body-hatching {
  background: #b7c3a0;
  clip-path: path(
    "M77 180 Q80 169 89 165 Q80 174 77 180 Z M81 184 Q85 172 93 170 Q87 175 81 184 Z M95 204 Q107 197 115 205 Q106 200 95 204 Z M99 209 Q109 204 116 209 Q106 207 99 209 Z"
  );
}
.cat-head {
  transform-origin: 133px 136px;
}
.head-coat {
  background: linear-gradient(
    122deg,
    #b6bd87 16%,
    #869b75 35%,
    #52796a 54%,
    #2c5650 74%
  );
  clip-path: path(
    "M75 77 C71 64 68 42 73 25 Q75 20 82 23 C95 28 106 38 118 46 Q127 41 140 42 L137 38 Q148 37 157 43 C170 31 184 17 197 13 Q202 13 202 20 Q205 40 199 63 C207 72 211 86 209 96 L217 93 Q214 102 207 107 L217 106 Q213 118 201 124 L205 126 Q194 143 167 151 C137 161 105 154 86 141 Q73 135 67 125 L73 125 Q63 119 59 108 L69 110 L62 100 L70 102 Q67 87 75 77 Z"
  );
}
.head-light {
  background: linear-gradient(145deg, #c0c79a, #a5b38f 54%, #809e88 78%);
  clip-path: path(
    "M77 28 Q80 26 94 36 L108 47 Q95 47 78 35 Z M73 88 C78 70 96 58 112 57 C102 62 94 69 91 78 Q98 74 107 73 Q94 80 90 91 Z M153 51 Q146 60 144 68 Q146 64 151 63 Q145 80 149 96 L155 107 Q145 115 138 106 Q135 88 140 76 Q132 83 126 86 Q134 68 141 61 Q147 56 153 51 Z"
  );
}
.ear-wells {
  background: #35544a;
  clip-path: path(
    "M80 34 Q94 39 110 52 Q90 58 79 73 Q75 48 80 34 Z M166 48 Q182 30 195 22 Q199 39 193 60 Q179 53 166 48 Z"
  );
}
.ear-silk {
  background: linear-gradient(114deg, #ddc19d 25%, #c49a81 67%);
  clip-path: path(
    "M81 39 Q92 42 102 50 L94 49 L98 54 Q88 56 81 64 Q83 56 81 54 Q79 48 81 39 Z M175 45 L192 29 Q193 39 191 51 L188 48 L187 54 Q183 49 175 45 Z"
  );
}
.head-stripes {
  background: linear-gradient(105deg, #617854 20%, #365e50 65%);
  clip-path: path(
    "M112 50 Q119 46 124 46 Q115 52 109 64 Q106 60 112 50 Z M125 47 L134 44 Q127 52 122 67 Q118 57 125 47 Z M139 45 Q148 44 150 46 Q142 51 136 59 Q134 55 139 45 Z M68 99 Q80 104 91 104 Q84 111 69 107 Z M72 114 Q84 118 92 116 Q87 125 78 122 Z M197 85 L206 80 L209 86 Q204 91 197 92 Z M198 96 L210 91 Q209 99 200 102 Z"
  );
}
.head-brows {
  background: #d1d6ad;
  clip-path: path(
    "M94 83 Q103 75 115 80 Q105 79 96 86 Z M166 72 Q177 65 186 73 Q176 69 167 76 Z"
  );
}
.face-mask {
  background: linear-gradient(
    114deg,
    #d2d3ab 11%,
    #eee9ce 46%,
    #f5edd4 63%,
    #b4bc9b 90%
  );
  clip-path: path(
    "M77 113 Q84 116 91 112 Q95 108 101 110 C107 121 125 124 137 112 Q145 99 153 101 Q159 103 165 111 C175 117 191 113 199 103 L205 103 Q203 113 193 119 L200 118 C192 127 184 134 172 136 Q158 152 144 151 L147 147 C129 152 115 146 106 138 Q91 135 83 125 L89 126 Q82 122 77 113 Z"
  );
}
.cat-eye {
  inset: auto;
  overflow: hidden;
  border-radius: 68% 38% 62% 40% / 80% 47% 60% 48%;
  background: #203935;
  transform-origin: center 63%;
}
.cat-eye::before,
.cat-eye i,
.cat-eye i::before,
.cat-eye i::after {
  content: "";
  position: absolute;
  border-radius: 50%;
}
.eye-near {
  left: 91px;
  top: 85px;
  width: 34px;
  height: 24px;
  rotate: 8deg;
}
.eye-far {
  left: 165px;
  top: 78px;
  width: 27px;
  height: 22px;
  rotate: -9deg;
}
.cat-eye::before {
  inset: 3px 1.5px 1.5px;
  background: linear-gradient(158deg, #98a779 8%, #d2ce90 43%, #f0dda0 85%);
}
.cat-eye i {
  inset: 3px 17% 0 41%;
  background: #183d3b;
}
.cat-eye i::before {
  width: 4px;
  height: 5px;
  top: 3px;
  left: 0;
  background: #fff9e8;
}
.cat-eye i::after {
  width: 2px;
  height: 2px;
  right: 2px;
  bottom: 3px;
  background: #a4c6ae;
}
.cat-nose {
  background: linear-gradient(162deg, #ae7f68 20%, #895b51 57%, #4f4842 76%);
  clip-path: path(
    "M142 111 Q147 108 151 110 Q155 107 160 108 Q164 109 160 113 L154 120 Q151 122 149 119 Q142 116 141 113 Q140 112 142 111 Z"
  );
}
.cat-smile {
  background: #595b4b;
  clip-path: path(
    "M152 119 Q154 122 153 125 Q158 129 165 122 Q161 131 154 128 L152 127 Q147 134 140 130 Q136 128 135 125 Q143 133 151 125 Z"
  );
}
.cat-freckles {
  background:
    radial-gradient(ellipse 1.2px 1px at 118px 122px, #66785d 86%, transparent),
    radial-gradient(ellipse 1.4px 1px at 123px 125px, #66785d 86%, transparent),
    radial-gradient(circle 1px at 117px 127px, #66785d 80%, transparent),
    radial-gradient(circle 1px at 175px 118px, #66785d 80%, transparent),
    radial-gradient(ellipse 1.3px 1px at 179px 115px, #66785d 80%, transparent);
}
.cat-whiskers {
  background: #455e50;
  clip-path: path(
    "M115 123 Q85 114 49 118 Q84 111 115 121.7 Z M113 127.5 Q75 124 46 136 Q77 121.5 113 126 Z M114 131.5 Q89 135 71 146 Q89 132.5 114 130 Z M181 115 Q199 104.5 226 103 Q203 105 181 116.4 Z M181 119 Q207 111.5 230 117 Q207 113.5 181 120.3 Z M182 123.2 Q202 122.2 218 129 Q201 123.5 182 124.5 Z"
  );
}

/* The board and its keys occupy the same plane. The front lip sits just
   below it, so a keystroke remains visible under either paw. */
.cat-keyboard {
  inset: 198px auto auto 109px;
  width: 155px;
  height: 36px;
  border: 1.5px solid #3c544d;
  border-radius: 4px;
  background: linear-gradient(170deg, #d8d6b7, #a4ad97);
  box-shadow:
    -2px 3px 0 #567166,
    -4px 5px 0 #264b48;
  transform-origin: 0 0;
  transform: matrix(1, -0.14, 0.86, 0.75, 0, 0);
}
.keyboard-well {
  inset: 3px 4px 4px;
  border-radius: 2px;
  background: #647a69;
}
.key-row {
  inset: 1px 2px auto;
  height: 5px;
  color: #e8e5cb;
  background: repeating-linear-gradient(
    to right,
    currentColor 0 8px,
    transparent 8px 10px
  );
  filter: drop-shadow(0 1px #344f48);
}
.key-row:nth-child(2) {
  top: 8px;
  background-position-x: 3px;
}
.key-row:nth-child(3) {
  top: 15px;
  background-position-x: 5px;
}
.key-space {
  inset: 22px 2px auto;
  height: 4px;
  background: linear-gradient(
    to right,
    #cad0b6 0 8%,
    transparent 8% 10%,
    #dde0c3 10% 18%,
    transparent 18% 20%,
    #eee7cb 20% 66%,
    transparent 66% 68%,
    #cbd2b9 68% 76%,
    transparent 76% 78%,
    #dde0c3 78% 86%,
    transparent 86% 88%,
    #cbd2b9 88%
  );
}
.key-accent,
.key-press {
  inset: 1px auto auto 2px;
  width: 8px;
  height: 5px;
  background: #b97657;
  box-shadow: 0 1px #5d6758;
}
.key-press {
  background: #e5e3c9;
}
.key-left {
  left: 27px;
  top: 8px;
}
.key-right {
  left: 97px;
  top: 8px;
}
.arm-near {
  transform-origin: 112px 151px;
}
.arm-far {
  transform-origin: 176px 146px;
}
.cat-arm::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(112deg, #eee8cc 31%, #cbd5b7 56%, #98ae98 75%);
}
.cat-arm .arm-toes {
  z-index: 1;
}
.arm-far::after {
  background: linear-gradient(118deg, #d0d5b6 45%, #9db19a 68%);
  clip-path: path(
    "M202 169 Q208 167 215 170 Q219 171 222 173 C226 176 227 181 224 183 Q222 186 219 185 Q216 189 212 187 Q208 190 204 187 Q198 185 195 183 Q200 183 200 179 L203 180 Q201 176 203 174 L200 175 Z"
  );
}
.arm-near::after {
  clip-path: path(
    "M139 184 Q144 184 149 185 C157 187 160 191 161 195 Q162 200 157 201 Q154 205 150 203 Q146 206 141 202 Q136 202 132 198 L129 196 Q132 196 132 191 L135 192 Q135 188 138 188 L136 187 Z"
  );
}
.arm-far .arm-fur {
  background: linear-gradient(135deg, #738c71 34%, #446b5c 51%, #2c5650 70%);
  clip-path: path(
    "M176 140 Q185 141 189 151 C191 160 194 166 206 168 Q217 168 222 173 C226 176 227 181 224 183 Q222 186 219 185 Q216 189 212 187 Q208 190 204 187 Q195 184 191 181 C175 177 169 161 168 151 Z"
  );
}
.arm-far .arm-toes {
  background: #667f70;
  clip-path: path(
    "M213 187 Q212 182 216 179 Q214 183 215 187 Z M219 185 Q219 180 222 178 Q220 182 221 185 Z"
  );
}
.arm-near .arm-fur {
  background: linear-gradient(
    120deg,
    #9daa81 22%,
    #779477 36%,
    #466e60 51%,
    #345d52 61%
  );
  clip-path: path(
    "M107 150 C117 147 125 153 126 165 C127 173 132 181 142 184 C153 184 160 190 161 195 Q162 200 157 201 Q154 205 150 203 Q146 206 141 202 Q136 202 132 198 C118 193 111 188 104 177 Q97 165 101 157 Z"
  );
}
.arm-near .arm-toes {
  background: linear-gradient(128deg, #395c4f 38%, #829481 60%);
  clip-path: path(
    "M145 203 Q144 198 148 194 Q146 199 148 204 Z M152 203 Q153 197 156 195 Q154 199 155 203 Z M101 161 Q110 164 115 162 Q113 167 104 167 Z M105 170 Q114 172 119 169 Q117 175 108 175 Z"
  );
}
@media (prefers-reduced-motion: no-preference) {
  .contact-cat {
    cursor: pointer;
  }
  .cat-tail {
    animation: cat-tail-curl 6.7s ease-in-out infinite;
  }
  .cat-head {
    animation: cat-concentrate 7.7s ease-in-out infinite;
  }
  .cat-eye {
    animation: cat-blink 7.7s ease-in-out infinite;
  }
  .cat-eye i {
    animation: cat-read-keys var(--typing-phrase) ease-in-out infinite;
  }
  .arm-near,
  .arm-far,
  .key-press {
    animation-duration: var(--typing-phrase);
    animation-timing-function: ease-in-out;
    animation-iteration-count: infinite;
  }
  .arm-near,
  .key-left {
    animation-name: cat-type-left;
  }
  .arm-far,
  .key-right {
    animation-name: cat-type-right;
  }
  .arm-near {
    --up: rotate(-7deg);
    --down: rotate(4deg);
  }
  .arm-far {
    --up: rotate(-9deg);
    --down: rotate(5deg);
  }
  .key-press {
    --up: none;
    --down: translateY(1.7px);
  }
  .contact-cat input:checked + .contact-cat-art * {
    animation-play-state: paused;
  }
  .contact-cat input:focus-visible + .contact-cat-art {
    outline: 2px solid var(--studio-teal);
    outline-offset: 4px;
    border-radius: 6px;
  }
  .contact-cat-art::after {
    content: "";
    position: absolute;
    bottom: 1%;
    left: 3%;
    width: 5px;
    height: 8px;
    box-sizing: content-box;
    border-inline: 2px solid var(--studio-teal);
    opacity: 0;
  }
  .contact-cat:is(:hover, :focus-within) .contact-cat-art::after,
  .contact-cat input:checked + .contact-cat-art::after {
    opacity: 0.7;
  }
  .contact-cat input:checked + .contact-cat-art::after {
    width: 0;
    height: 0;
    border: solid transparent;
    border-width: 5px 0 5px 8px;
    border-left-color: var(--studio-teal);
  }
}
@keyframes cat-type-left {
  0%,
  8%,
  16%,
  29%,
  37%,
  44%,
  55%,
  68%,
  76%,
  83%,
  100% {
    transform: var(--up);
  }
  4%,
  12%,
  25%,
  33%,
  40%,
  51%,
  64%,
  72%,
  80% {
    transform: var(--down);
  }
}
@keyframes cat-type-right {
  0%,
  4%,
  11%,
  20%,
  31%,
  41%,
  49%,
  61%,
  72%,
  80%,
  89%,
  100% {
    transform: var(--up);
  }
  7%,
  16%,
  27%,
  37%,
  45%,
  57%,
  68%,
  76%,
  86% {
    transform: var(--down);
  }
}
@keyframes cat-concentrate {
  0%,
  100% {
    transform: rotate(0deg);
  }
  22%,
  41% {
    transform: translateY(1px) rotate(1.4deg);
  }
  64%,
  73% {
    transform: translateY(-1.5px) rotate(-2.2deg);
  }
}
@keyframes cat-read-keys {
  0%,
  17%,
  47%,
  80%,
  100% {
    transform: translate(1px, 2px);
  }
  23%,
  38%,
  66% {
    transform: translate(-2px, 2.5px);
  }
  89%,
  95% {
    transform: translate(0, -1.5px);
  }
}
@keyframes cat-blink {
  0%,
  28%,
  31%,
  73%,
  76%,
  100% {
    transform: scaleY(1);
  }
  29.5%,
  74.4% {
    transform: scaleY(0.07);
  }
}
@keyframes cat-tail-curl {
  0%,
  100% {
    transform: rotate(-1.7deg);
  }
  46%,
  55% {
    transform: rotate(3.2deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  .contact-cat input {
    display: none;
  }
}
