/* ==========================================================
   GLOBAL TRANSITIONS
========================================================== */

* {
  transition:
    background-color 0.3s ease,
    color 0.3s ease,
    border-color 0.3s ease;
}

/* ==========================================================
   PAGE LOAD
========================================================== */

body {
  animation: fadeIn 0.8s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

/* ==========================================================
   PAPER FLOAT
========================================================== */

.paper-texture {
  animation: paperFloat 14s ease-in-out infinite;
}

@keyframes paperFloat {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-12px);
  }
}

/* ==========================================================
   HALFTONE
========================================================== */

.halftone {
  animation: halftoneMove 20s ease-in-out infinite;
}

@keyframes halftoneMove {
  0%,
  100% {
    transform: translate(0, 0);
  }

  50% {
    transform: translate(20px, -20px);
  }
}

/* ==========================================================
   FLOATING PANELS
========================================================== */

.floating-panels span {
  animation: floatPanel 12s ease-in-out infinite;
}

.floating-panels span:nth-child(2) {
  animation-delay: 2s;
}

.floating-panels span:nth-child(3) {
  animation-delay: 4s;
}

.floating-panels span:nth-child(4) {
  animation-delay: 6s;
}

@keyframes floatPanel {
  0%,
  100% {
    transform: translateY(0) rotate(-6deg);
  }

  50% {
    transform: translateY(-20px) rotate(-2deg);
  }
}

/* ==========================================================
   SPEED LINES
========================================================== */

.speed-lines {
  animation: speedMove 15s linear infinite;
}

@keyframes speedMove {
  from {
    background-position: 0 0;
  }

  to {
    background-position: 0 600px;
  }
}

/* ==========================================================
   CHAPTER BOX
========================================================== */

.chapter-box {
  animation: chapterReveal 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes chapterReveal {
  from {
    opacity: 0;
    transform: translateY(-40px) scale(0.96);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ==========================================================
   CARD
========================================================== */

.manga-card {
  animation: cardReveal 1s ease;
}

@keyframes cardReveal {
  from {
    opacity: 0;
    transform: translateY(40px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==========================================================
   PANELS
========================================================== */

.panel {
  animation: panelFade 0.8s ease both;
}

.panel:nth-child(1) {
  animation-delay: 0.1s;
}

.panel:nth-child(2) {
  animation-delay: 0.25s;
}

.panel:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes panelFade {
  from {
    opacity: 0;
    transform: translateX(-40px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ==========================================================
   INPUTS
========================================================== */

.input-group input {
  transition: 0.3s ease;
}

.input-group input:hover {
  transform: translateY(-2px);
}

.input-group input:focus {
  animation: inputPulse 0.45s ease;
}

@keyframes inputPulse {
  0% {
    transform: scale(0.98);
  }

  50% {
    transform: scale(1.02);
  }

  100% {
    transform: scale(1);
  }
}

/* ==========================================================
   BUTTONS
========================================================== */

button {
  position: relative;
  overflow: hidden;
}

button::before {
  content: "";
  position: absolute;
  inset: 0;
  left: -120%;
  background: linear-gradient(
    120deg,
    transparent,
    rgb(255 255 255 / 35%),
    transparent
  );
  transition: 0.6s;
}

button:hover::before {
  left: 120%;
}

button:hover {
  cursor: pointer;
}

button:active {
  transform: scale(0.95);
}

/* ==========================================================
   OUTPUT
========================================================== */

.output-panel {
  transition: 0.4s ease;
}

.output-panel:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}

.output-panel::after {
  content: "";
  position: absolute;
  width: 0;
  height: 100%;
  top: 0;
  left: 0;
  background: rgb(225 29 72 / 6%);
  transition: 0.6s;
}

.output-panel:hover::after {
  width: 100%;
}

/* ==========================================================
   TEXT REVEAL
========================================================== */

.output-panel b {
  display: inline-block;
  animation: textReveal 0.45s ease;
}

@keyframes textReveal {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==========================================================
   FOOTER
========================================================== */

footer {
  animation: fadeUp 1.3s ease;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==========================================================
   HOVER EFFECTS
========================================================== */

.chapter-box:hover,
.manga-card:hover {
  transform: translateY(-6px);
  transition: 0.35s ease;
}

/* ==========================================================
   SUBTLE BREATHING
========================================================== */

.container {
  animation: breathing 8s ease-in-out infinite;
}

@keyframes breathing {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-4px);
  }
}
