:root {
  --paper: #fafaf7;
  --ink: #22231f;
  --blue: #343fff;
  --lime: #dcf986;
  --line: #ddded6;
}
* {
  box-sizing: border-box;
}
html {
  min-width: 320px;
}
body {
  margin: 0;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a {
  color: inherit;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
a:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 7px;
}
::selection {
  background: var(--lime);
  color: var(--ink);
}
.frame {
  width: min(1380px, calc(100% - 112px));
  margin-inline: auto;
}
.error-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 105px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 26px;
  font-weight: 750;
  letter-spacing: -1.4px;
}
.brand img {
  width: 30px;
  height: 30px;
}
.header-back {
  display: inline-flex;
  align-items: center;
  gap: 18px;
  font-size: 14px;
}
.header-back span {
  display: inline-block;
  font-size: 23px;
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
.header-back:hover span {
  transform: translateX(-6px);
}
.error-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-block: 25px 72px;
}
.error-art {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 25px;
  width: min(850px, 86%);
  height: clamp(220px, 30vw, 430px);
  position: relative;
  margin: 0 auto 32px;
  user-select: none;
}
.four {
  font-size: clamp(240px, 33vw, 460px);
  font-weight: 500;
  line-height: 0.8;
  letter-spacing: -0.1em;
  position: relative;
  z-index: 1;
  animation: arrive 0.9s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.four-left {
  transform: rotate(-8deg);
  transform-origin: 50% 85%;
  animation-delay: 0.08s;
}
.four-right {
  transform: rotate(8deg);
  transform-origin: 50% 85%;
  margin-left: 3%;
  animation-delay: 0.2s;
}
.zero {
  width: 30%;
  aspect-ratio: 0.72;
  border: clamp(17px, 2.5vw, 36px) solid var(--blue);
  border-radius: 50%;
  position: relative;
  margin-top: 9px;
  transform: rotate(-7deg);
  animation: zero-arrive 1s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.eye {
  position: absolute;
  width: 74%;
  aspect-ratio: 1.12;
  left: 13%;
  top: 33%;
  border-radius: 50%;
  display: grid;
  place-items: center;
  overflow: hidden;
  transform: rotate(7deg);
  background: #fff;
}
.pupil {
  width: 52%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--ink);
  transform: translate(var(--eye-x, 0px), var(--eye-y, 0px));
  will-change: transform;
}
.pupil i {
  position: absolute;
  width: 20%;
  height: 20%;
  border-radius: 50%;
  background: var(--paper);
  top: 18%;
  right: 20%;
}
.eye-spark {
  position: absolute;
  right: -45%;
  top: -14%;
  width: 36%;
  fill: none;
  stroke: var(--blue);
  stroke-width: 3.5;
  stroke-linecap: round;
  transform: rotate(11deg);
}
.sticker {
  position: absolute;
  right: -6%;
  top: 19%;
  font-size: 18px;
  background: var(--lime);
  border: 1px solid var(--ink);
  padding: 17px 24px;
  transform: rotate(11deg);
  border-radius: 50%;
  z-index: 2;
  box-shadow: 3px 3px 0 var(--ink);
  animation: sticker-arrive 1s 0.35s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.lost-line {
  position: absolute;
  left: -18%;
  bottom: 1%;
  width: 27%;
  fill: none;
  stroke: var(--blue);
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  transform: rotate(12deg);
  stroke-dasharray: 500;
  stroke-dashoffset: 500;
  animation: draw 1.3s 0.55s ease forwards;
}
.error-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 35px;
  width: min(900px, 100%);
  margin-inline: auto;
}
h1 {
  font-size: clamp(46px, 5.4vw, 74px);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.065em;
  margin: 0;
}
h1 span {
  position: relative;
  color: var(--blue);
}
h1 svg {
  position: absolute;
  left: 0;
  bottom: -7px;
  width: 102%;
  height: 12px;
  overflow: visible;
  fill: none;
  stroke: var(--blue);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: draw 0.8s 0.6s ease forwards;
}
.error-copy p {
  font-size: 15px;
  color: #707268;
  line-height: 1.5;
  margin: 22px 0 0;
}
.home-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 48px;
  background: var(--blue);
  color: #fff;
  border: 1px solid var(--blue);
  border-radius: 100px;
  padding: 23px 27px 23px 31px;
  font-size: 18px;
  transition:
    background 0.3s,
    color 0.3s,
    transform 0.3s;
  white-space: nowrap;
}
.home-button:hover {
  background: var(--lime);
  border-color: var(--ink);
  color: var(--ink);
  transform: rotate(-3deg);
}
.arrow-window {
  position: relative;
  width: 32px;
  height: 32px;
  overflow: hidden;
}
.arrow-window svg {
  position: absolute;
  inset: 0;
  width: 32px;
  height: 32px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}
.arrow-window svg + svg {
  transform: translateX(115%);
}
.home-button:hover .arrow-window svg:first-child {
  transform: translateX(-115%);
}
.home-button:hover .arrow-window svg + svg {
  transform: translateX(0);
}
.error-footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding-block: 25px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: #707268;
}
@keyframes draw {
  to {
    stroke-dashoffset: 0;
  }
}
@keyframes arrive {
  from {
    opacity: 0;
    translate: 0 45px;
    rotate: -8deg;
  }
  to {
    opacity: 1;
    translate: 0 0;
    rotate: 0deg;
  }
}
@keyframes zero-arrive {
  from {
    opacity: 0;
    scale: 0.8;
    rotate: 25deg;
  }
  to {
    opacity: 1;
    scale: 1;
    rotate: 0deg;
  }
}
@keyframes sticker-arrive {
  from {
    opacity: 0;
    scale: 0.65;
    rotate: -18deg;
  }
  to {
    opacity: 1;
    scale: 1;
    rotate: 0deg;
  }
}
@media (max-width: 900px) {
  .frame {
    width: calc(100% - 64px);
  }
  .error-main {
    padding-block: 35px 65px;
  }
  .error-art {
    margin-bottom: 55px;
    gap: 16px;
    width: 86%;
    height: 34vw;
  }
  .four {
    font-size: 39vw;
  }
  .zero {
    border-width: 2.8vw;
    width: 30%;
  }
  .sticker {
    right: -9%;
    font-size: 14px;
    padding: 14px 18px;
  }
  .lost-line {
    left: -8%;
    bottom: -12%;
    width: 23%;
  }
  .error-bottom {
    width: 100%;
  }
  .home-button {
    gap: 28px;
    font-size: 16px;
    padding: 20px 23px;
  }
}
@media (max-width: 600px) {
  .frame {
    width: calc(100% - 40px);
  }
  .error-header {
    min-height: 84px;
  }
  .brand {
    font-size: 23px;
  }
  .brand img {
    width: 26px;
    height: 26px;
  }
  .header-back {
    font-size: 12px;
    gap: 11px;
  }
  .error-main {
    padding-block: 40px 45px;
    justify-content: center;
  }
  .error-art {
    width: 95%;
    height: 42vw;
    margin: 0 auto 56px;
    gap: 10px;
  }
  .four {
    font-size: 44vw;
  }
  .zero {
    width: 29%;
    border-width: 3.1vw;
  }
  .eye-spark {
    right: -52%;
    top: -20%;
    width: 41%;
    stroke-width: 4;
  }
  .sticker {
    right: -1%;
    top: -25%;
    font-size: 12px;
    padding: 11px 14px;
    box-shadow: 2px 2px 0 var(--ink);
  }
  .lost-line {
    left: -2%;
    bottom: -26%;
    width: 28%;
  }
  .error-bottom {
    align-items: flex-start;
    flex-direction: column;
    gap: 28px;
  }
  .error-copy h1 {
    font-size: clamp(49px, 13.5vw, 70px);
  }
  .error-copy p {
    font-size: 13px;
    margin-top: 19px;
  }
  .home-button {
    padding: 16px 21px 16px 24px;
    gap: 40px;
    font-size: 15px;
  }
  .arrow-window,
  .arrow-window svg {
    width: 28px;
    height: 28px;
  }
  .error-footer {
    font-size: 10px;
    padding-block: 21px;
  }
  .error-footer span:first-child {
    max-width: 155px;
    line-height: 1.5;
  }
  .error-footer span:last-child {
    white-space: nowrap;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
  .lost-line,
  h1 svg {
    stroke-dashoffset: 0;
  }
  .pupil {
    will-change: auto;
  }
}
