*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
@property --pointerColor {
  syntax: '<color>';
  inherits: false;
  initial-value: #000;
}

@font-face {
  font-family: 'Kanit-R';
  src: url('../assets/font/Kanit/Kanit-SemiBoldItalic.ttf');
}

:root {
  --ani-bezier: cubic-bezier(0.22, 0.58, 0.12, 0.98);
  --dot-bg: #F8F9FD;
  --dot-item: #e5e7eb;
  --juchats-animation-delay: 0.5s; /* Juchats文字动画网页打开后延迟播放时间 */
  --juchats-duration: 5s; /* Juchats文字动画持续时间 */
  --logo-animation-0-stroke: rgba(0, 0, 0, 0.3);
  --logo-animation-1-stroke: rgba(0, 0, 0, 0.9);
  --logo-animation-2-stroke: #000;
  --logo-animation-3-stroke: #000;

  --logo-fade-out-delay: 2.7s;

  --draw-delay: 2.9s; /* 图形画线Logo网页打开后动画延迟时间 */
  --fade-in-delay: 4.3s; /* 实心图形画线Logo开始显示的时间点 */
  --fade-out-delay: 4.6s; /* 双线图形画线Logo开始消失的时间点 */

  --black: #000;
}

@media (prefers-color-scheme: dark) {
  :root {
    --dot-bg: #1B1B1B;
    --dot-item: #2A2A2A;
    --logo-animation-0-stroke: rgba(255, 255, 255, 0.3);
    --logo-animation-1-stroke: rgba(255, 255, 255, 0.9);
    --logo-animation-2-stroke: #fff;
    --logo-animation-3-stroke: #fff;
    --black: #fff;
  }
}

body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.flex-c {
  display: flex;
  align-items: center;
  justify-content: center;
}

.absolute-x-center {
  position: absolute;
  left: 0;
  right: 0;
  margin-inline-start: auto;
  margin-inline-end: auto;
  width: fit-content;
}

.background {
  position: fixed;
  inset: 0;
  height: 100%;
  width: 100%;
  background-image: radial-gradient(var(--dot-item) 1px, transparent 1px);
  background-size: 20px 20px;
  background-color: var(--dot-bg);
  z-index: -1;
}
.type-wrapper {
  width: 410px;
}

.container {
  text-align: center;
  padding: 2rem;
  margin-bottom: 10rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.logo-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
}


.logo {
  width: 320px;
  margin-bottom: 1rem;
  animation: fadeOutLogo 0.8s var(--ani-bezier) var(--logo-fade-out-delay) forwards;
}

.logo text {
  font-family: Kanit-R, system-ui, sans-serif;
  font-size: 28px;
  font-weight: 600;
  font-style: italic;
}

.first-part {
  animation: code-bg-animated-ju var(--juchats-duration) var(--ani-bezier);
  animation-fill-mode: both;
  animation-delay: var(--juchats-animation-delay);
}

.second-part {
  animation: code-bg-animated-chats var(--juchats-duration) var(--ani-bezier);
  animation-fill-mode: both;
  animation-delay: var(--juchats-animation-delay);
}

.slogan {
  font-size: 1.5rem;
  font-weight: 700;
  text-align: left;
}

@keyframes code-bg-animated-ju {
  0% {
    fill: #0000;
    stroke: #f058586a;
    stroke-dashoffset: 40%;
    stroke-dasharray: 0 60%;
    stroke-width: 0.7;
  }

  26% {
    fill: #0000;
    stroke: #f05858e8;
    stroke-width: 0.5;
  }

  70% {
    fill: #f05858f1;
    stroke: #f0585814;
    stroke-width: 0.1;
  }

  90%,
  100% {
    fill: #F05858;
    stroke: #0000;
    stroke-dashoffset: -40%;
    stroke-dasharray: 60% 0;
    stroke-width: 0;
  }
}

@keyframes code-bg-animated-chats {
  0% {
    fill: #0000;
    stroke: var(--logo-animation-0-stroke);
    stroke-dashoffset: 40%;
    stroke-dasharray: 0 60%;
    stroke-width: 0.7;
  }

  26% {
    fill: #0000;
    stroke: var(--logo-animation-1-stroke);
    stroke-width: 0.5;
  }

  70% {
    fill: var(--logo-animation-2-stroke);
    stroke: var(--logo-animation-0-stroke);
    stroke-width: 0.1;
  }

  90%,
  100% {
    fill: var(--logo-animation-3-stroke);
    stroke: #0000;
    stroke-dashoffset: -40%;
    stroke-dasharray: 60% 0;
    stroke-width: 0;
  }
}


.slogan-wrapper {
  padding: 4px 8px;
  display: inline-block;
  text-align: left;
  width: 100%;

  min-height: 40px;
  margin-top: 30px;
  margin-left: 10px;
}

.double-line-wrapper {
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 60px;
}
.second-section {
  animation: moveX 0.8s var(--ani-bezier) var(--draw-delay) forwards;
}

.t-logo {
  position: absolute;
  margin-top: 18px;
  color: #DBDBDB;
}

.t-logo svg {
  width: 70px;
  height: 45px;
}

.logo-outline .animated-path {
  stroke-dasharray: 1000;
  stroke-dashoffset: 1000;
  animation: draw 2s cubic-bezier(0.0, 0.015, 0.925, 0.114) forwards;
  animation-delay: var(--draw-delay);
}

.logo-filled {
  opacity: 0;
  animation: fadeIn 0.3s ease-out var(--fade-in-delay) forwards;
  color: var(--black);
}

.logo-outline {
  opacity: 1;
  animation: fadeOut 0.8s var(--ani-bezier) var(--fade-out-delay) forwards;
}

@keyframes draw {
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes moveX {
  from {
    transform: translateX(36px);
    opacity: 0;
  }
  to {
    transform: translateX(-26px);
    opacity: 1;
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

@media (prefers-color-scheme: dark) {
  .logo {
    color: #fff;
  }
}

@media (prefers-color-scheme: light) {
  .logo {
    color: #000;
  }
}


#slogan-wrapper-content {
  background: linear-gradient(90deg, transparent, transparent calc(100% - 2px), var(--pointerColor) calc(100% - 2px), var(--pointerColor));
  background-size: 100% 70%;
  background-position: 0 5px;
  background-repeat: no-repeat;
  animation: colorChange .8s linear infinite;
  padding-right: 8px;
  color: var(--black);
}

@keyframes colorChange {
  0%,
  40% {
    --pointerColor: var(--black)
  }

  60%,
  100% {
    --pointerColor: transparent;
  }
}

@keyframes fadeOutLogo {
  from { opacity: 1; }
  to { 
    opacity: 0;
    transform: translateX(-146px);
   }
}
