:root {
  --bg: #0b1117;
  --card: rgba(8, 12, 18, 0.88);
  --text: #e8edf2;
  --muted: #8ca0b5;
  --accent: #8dd7ff;
  --accent-2: #768eba;
  --shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
  --border: rgba(56, 189, 248, 0.16);
  --glow: 0 0 60px rgba(56, 189, 248, 0.24);
  --gradient: linear-gradient(120deg, var(--accent), var(--accent-2));
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  background: radial-gradient(circle at 20% 10%, rgba(56,189,248,0.16), transparent 26%),
              radial-gradient(circle at 78% 18%, rgba(245,158,11,0.18), transparent 30%),
              radial-gradient(circle at 50% 80%, rgba(34,197,94,0.12), transparent 30%),
              linear-gradient(160deg, #0a1216 0%, #0c151c 55%, #0a1117 100%);
  color: var(--text);
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 16px;
  opacity: 0;
  transition: background 0.6s ease, color 0.6s ease, opacity 0.7s ease;
}
body.ready { opacity: 1; }
.shell {
  position: relative;
  width: min(1200px, 100%);
  display: grid;
  gap: 24px;
  grid-template-columns: 1fr;
  align-items: start;
}
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow);
  padding: 32px;
  backdrop-filter: blur(12px);
  opacity: 0;
  transform: translateY(18px) scale(0.99);
  transition: transform 0.4s ease, box-shadow 0.3s ease, border-color 0.3s ease, opacity 0.5s ease;
}
.card:hover {
  transform: translateY(-6px);
  box-shadow: var(--glow);
  border-color: rgba(56, 189, 248, 0.3);
}
h1 {
  margin: 0 0 12px;
  font-size: clamp(32px, 5vw, 48px);
  letter-spacing: -0.03em;
}
p {
  margin: 0 0 18px;
  line-height: 1.6;
  color: var(--muted);
  font-size: 16px;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--gradient);
  border-radius: 999px;
  color: white;
  border: 1px solid rgba(56,189,248,0.35);
  font-weight: 600;
  letter-spacing: -0.01em;
}
.actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 12px;
  margin-top: 18px;
  align-items: center;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.45s ease, transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}
.actions .btn {
  flex: 1 1 0;
  min-width: 0;
  --btn-lift: 0px;
  --jitter-phase: 0ms;
  will-change: transform;
}

@keyframes actionsBtnJitter {
  0%, 100% { transform: translateY(var(--btn-lift)) translateX(0) rotate(0deg) scale(1); }
  10%      { transform: translateY(calc(var(--btn-lift) + 0.3px)) translateX(0.9px) rotate(-0.22deg) scale(1.004); }
  20%      { transform: translateY(calc(var(--btn-lift) - 0.3px)) translateX(-0.9px) rotate(0.22deg)  scale(1.004); }
  30%      { transform: translateY(calc(var(--btn-lift) + 0.15px)) translateX(0.7px) rotate(0.16deg)  scale(1.003); }
  40%      { transform: translateY(calc(var(--btn-lift) - 0.15px)) translateX(-0.6px) rotate(-0.16deg) scale(1.003); }
  50%      { transform: translateY(calc(var(--btn-lift) + 0.1px)) translateX(0.45px) rotate(0deg)    scale(1.002); }
  60%      { transform: translateY(calc(var(--btn-lift) - 0.1px)) translateX(-0.45px) rotate(0.14deg) scale(1.003); }
  70%      { transform: translateY(calc(var(--btn-lift) + 0.12px)) translateX(0.6px) rotate(-0.14deg) scale(1.003); }
  80%      { transform: translateY(calc(var(--btn-lift) - 0.12px)) translateX(-0.35px) rotate(0.18deg) scale(1.003); }
  90%      { transform: translateY(calc(var(--btn-lift) + 0.12px)) translateX(0.35px) rotate(-0.18deg) scale(1.003); }
}

.actions .btn:hover { --btn-lift: -2px; }
.actions .btn:active { --btn-lift: 0px; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  cursor: pointer;
  border-radius: 12px;
  padding: 14px 18px;
  min-height: 72px;
  font-weight: 700;
  letter-spacing: -0.01em;
  transition: transform 0.25s ease, box-shadow 0.2s ease, background 0.25s ease, color 0.25s ease, border-color 0.25s ease, opacity 0.4s ease;
  text-decoration: none;
  position: relative;
  overflow: hidden;
  opacity: 0;
  transform: translateY(16px) scale(0.98);
}
.btn.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  box-shadow: 0 12px 30px rgba(124,58,237,0.35), 0 6px 20px rgba(0,0,0,0.25);
  /* border: 1px solid rgba(255,255,255,0.08); */
}
.btn.secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid rgba(56, 189, 248, 0.2);
  backdrop-filter: blur(10px);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.02);
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.08), rgba(255,255,255,0));
  opacity: 0;
  transition: opacity 0.2s ease;
}
.btn:hover::after { opacity: 1; }
.meta {
  display: grid;
  gap: 10px;
  margin-top: 22px;
}
.meta-row {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 14px;
}
.badge {
  background: rgba(124, 58, 237, 0.08);
  color: var(--accent);
  border-radius: 8px;
  padding: 6px 10px;
  border: 1px solid rgba(124, 58, 237, 0.15);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.01em;
}
.mock {
  position: relative;
  isolation: isolate;
  background: radial-gradient(circle at 30% 20%, rgba(56,189,248,0.32), transparent 40%),
              radial-gradient(circle at 80% 80%, rgba(245,158,11,0.26), transparent 40%),
              linear-gradient(145deg, rgba(255,255,255,0.12), rgba(255,255,255,0.04));
  border-radius: 20px;
  border: 1px solid var(--border);
  height: 360px;
  overflow: hidden;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(24px) scale(0.99);
  transition: transform 0.45s ease, box-shadow 0.3s ease, opacity 0.6s ease;
  z-index: 0;
}
.mock::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, rgba(255,255,255,0.08), rgba(255,255,255,0));
  mix-blend-mode: screen;
}
.mock img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(1.05) contrast(1.05);
  border-radius: 20px;
}
.mock video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(1.05) contrast(1.05);
  border-radius: 20px;
}
footer {
  margin-top: 26px;
  color: var(--muted);
  font-size: 14px;
  letter-spacing: 0.01em;
}
.blur {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 20% 20%, rgba(56,189,248,0.12), transparent 30%),
              radial-gradient(circle at 80% 0%, rgba(245,158,11,0.16), transparent 30%),
              radial-gradient(circle at 50% 80%, rgba(34,197,94,0.1), transparent 30%);
  filter: blur(60px);
  opacity: 0.7;
  z-index: -1;
  pointer-events: none;
}
@media (max-width: 720px) {
  .shell { grid-template-columns: 1fr; }
  .card { padding: 24px; }
  .mock { height: 280px; }
  .characters {
    right: 40px;
    bottom: 40px;
  }
}
@media (min-width: 1024px) {
  .shell {
    grid-template-columns: 1fr;
    padding-right: 0;
    position: relative;
    min-height: 600px;
  }
  .card {
    max-width: 560px;
    z-index: 2;
  }
  .mock {
    position: absolute;
    top: -40px;
    right: 0;
    width: 70%;
    height: 65%;
    min-height: 550px;
    pointer-events: none;
    border-radius: 24px;
    box-shadow: 0 25px 60px -20px rgba(0,0,0,0.55);
  }
  .mock img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
  .characters {
    right: 40px;
    bottom: 40px;
  }
}
body.ready .card {
  opacity: 1;
  transform: translateY(0) scale(1);
  transition-delay: 60ms;
}
body.ready .mock {
  opacity: 1;
  transform: translateY(0) scale(1);
  transition-delay: 140ms;
}
body.ready .actions {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 120ms;
}
body.ready .actions .btn {
  opacity: 1;
  transform: translateY(0) scale(1);
  animation: actionsBtnJitter 4.8s ease-in-out infinite;
  animation-delay: calc(700ms + var(--jitter-phase));
}
body.ready .actions .btn:nth-child(1) { --jitter-phase: -0ms; }
body.ready .actions .btn:nth-child(2) { --jitter-phase: -1200ms; }
body.ready .actions .btn:nth-child(3) { --jitter-phase: -2400ms; }
body.ready .actions .btn:nth-child(4) { --jitter-phase: -3600ms; }
body.ready .actions .btn:hover {
  animation-duration: 0.65s;
}

@media (prefers-reduced-motion: reduce) {
  body.ready .actions .btn { animation: none; }
}
body.ready .actions .btn:nth-child(1) { transition-delay: 160ms; }
body.ready .actions .btn:nth-child(2) { transition-delay: 210ms; }
body.ready .actions .btn:nth-child(3) { transition-delay: 260ms; }
body.ready .actions .btn:nth-child(4) { transition-delay: 310ms; }

/* Characters section */
.characters {
  position: absolute;
  bottom: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
  z-index: 2;
}
.characters__label {
  margin: 0;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--accent);
  font-size: 14px;
}
.characters__list {
  display: flex;
  gap: 12px;
  flex-direction: row;
  position: relative;
  z-index: 2;
  align-content: center;
  flex-wrap: nowrap;
}
.character-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 25px;
  border-radius: 999px;
  border: 1px solid rgba(56, 189, 248, 0.16);
  background: rgba(8, 12, 18, 0.88);
  color: var(--text);
  cursor: pointer;
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.character-chip:hover {
  transform: translateY(-3px) scale(1.03);
  border-color: rgba(56, 189, 248, 0.6);
  box-shadow: 0 16px 40px rgba(56, 189, 248, 0.3), 0 8px 24px rgba(0, 0, 0, 0.35);
}
.character-chip:active {
  transform: translateY(-1px) scale(1.01);
}
.chip-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid rgba(56, 189, 248, 0.3);
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.4), inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}
.chip-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.chip-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: flex-start;
}
.chip-text strong { 
  font-size: 15px;
  font-weight: 700;
}
.chip-text span {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

/* Modal styles */
.modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 16px;
  overflow-y: auto;
}
.modal.active {
  opacity: 1;
  pointer-events: all;
}
.modal__backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  cursor: pointer;
}
.modal__content {
  position: relative;
  max-width: 1000px;
  width: 100%;
  max-height: calc(100vh - 32px);
  background: linear-gradient(135deg, rgba(8, 12, 18, 0.98), rgba(14, 23, 32, 0.95));
  border: 1px solid rgba(56, 189, 248, 0.4);
  border-radius: 24px;
  padding: 24px;
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.7), 0 0 80px rgba(56, 189, 248, 0.3);
  transform: scale(0.9) translateY(30px);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  margin: auto;
}
.modal__content::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 30% 20%, rgba(56, 189, 248, 0.18), transparent 50%),
              radial-gradient(circle at 80% 70%, rgba(245, 158, 11, 0.15), transparent 50%);
  opacity: 0.8;
  pointer-events: none;
  z-index: 0;
}
.modal.active .modal__content {
  transform: scale(1) translateY(0);
}
.modal__close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  border: none;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font-size: 32px;
  line-height: 1;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal__close:hover {
  background: rgba(255, 59, 48, 0.2);
  color: #ff3b30;
  transform: rotate(90deg);
}
.modal__body {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 24px;
  flex-direction: column;
}
.modal__art {
  flex-shrink: 0;
  width: 100%;
  max-width: 280px;
  aspect-ratio: 1;
  border-radius: 20px;
  overflow: hidden;
  border: 2px solid rgba(56, 189, 248, 0.4);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), 0 0 40px rgba(56, 189, 248, 0.3);
  margin: 0 auto;
}
.modal__art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.modal__info {
  flex: 1;
  min-width: 0;
}
.character-meta {
  font-size: 13px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 8px;
}
.character-name {
  margin: 0 0 16px;
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--accent);
}
.character-desc {
  margin: 0 0 20px;
  color: var(--muted);
  line-height: 1.65;
  font-size: 17px;
}
.character-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.character-tags span {
  padding: 10px 16px;
  border-radius: 12px;
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.3);
  font-size: 14px;
  color: var(--text);
  font-weight: 500;
}

@media (min-width: 640px) {
  .modal__body {
    flex-direction: row;
  }
  .modal__art {
    margin: 0;
  }
  .modal__content {
    padding: 36px;
  }
}
