:root {
  --bg: #0d0715;
  --card: #181022;
  --card-alt: #241933;
  --border: #33234a;
  --text: #ffffff;
  --text-dim: #cfc7dc;
  --text-muted: #8a7fa0;
  --accent-1: #7b2ff7;
  --accent-2: #f107a3;
  --gradient: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  --success: #23c47a;
  --danger: #ff5470;
  --radius: 16px;
  --radius-sm: 10px;
  --font-display: "Unbounded", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Inter", "Helvetica Neue", Arial, sans-serif;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background-color: var(--bg);
  background-image:
    radial-gradient(circle at 15% 20%, rgba(123, 47, 247, 0.2), transparent 45%),
    radial-gradient(circle at 85% 10%, rgba(241, 7, 163, 0.16), transparent 40%);
  color: var(--text);
  font-family: var(--font-body);
  min-height: 100vh;
  overflow-x: hidden;
}

h1,
h2,
h3,
.brand-name,
.btn {
  font-family: var(--font-display);
}

a {
  color: var(--accent-2);
}

.container {
  max-width: 880px;
  margin: 0 auto;
  padding: 0 20px;
  position: relative;
}

/* Film-grain texture, fixed above everything */
.grain-overlay {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 200;
  pointer-events: none;
  mix-blend-mode: overlay;
  opacity: 0.5;
}

/* Reveal-on-load (staggered via inline --delay) */
.reveal-in {
  opacity: 0;
  transform: translateY(16px);
  animation: revealIn 0.8s var(--ease-out) forwards;
  animation-delay: var(--delay, 0s);
  animation-play-state: paused;
}

body.ready .reveal-in {
  animation-play-state: running;
}

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

/* Reveal-on-scroll */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}

.reveal.in-view {
  opacity: 1;
  transform: translateY(0);
}

/* Topbar / brand */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 28px 0 16px;
  position: relative;
  z-index: 2;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  animation: twinkle 3.5s ease-in-out infinite;
  transform-origin: center;
}

@keyframes twinkle {
  0%,
  100% {
    transform: scale(1) rotate(0deg);
    opacity: 1;
  }
  50% {
    transform: scale(1.15) rotate(20deg);
    opacity: 0.85;
  }
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.brand-name {
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text);
}

.brand-name em {
  font-style: normal;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.brand-tagline {
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  margin-top: 2px;
}

/* Hero */

.hero {
  position: relative;
  padding: 56px 0 32px;
  overflow: visible;
}

.hero-bg {
  position: absolute;
  inset: -80px -20px;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  border-radius: var(--radius);
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.55;
  will-change: transform;
}

.blob-a {
  width: 320px;
  height: 320px;
  top: -60px;
  left: -40px;
  background: radial-gradient(circle, var(--accent-1), transparent 70%);
  animation: driftA 22s ease-in-out infinite;
}

.blob-b {
  width: 280px;
  height: 280px;
  top: 40px;
  right: -60px;
  background: radial-gradient(circle, var(--accent-2), transparent 70%);
  animation: driftB 26s ease-in-out infinite;
}

@keyframes driftA {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }
  50% {
    transform: translate(40px, 30px) scale(1.1);
  }
}

@keyframes driftB {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }
  50% {
    transform: translate(-30px, 20px) scale(1.08);
  }
}

.sunburst {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 700px;
  height: 700px;
  transform: translate(-50%, -50%);
  opacity: 0.35;
  animation: spinSlow 90s linear infinite;
}

@keyframes spinSlow {
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

.sunburst-rays {
  transform-origin: 300px 300px;
}

.scanline {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 0%, rgba(255, 255, 255, 0.04) 50%, transparent 100%);
  height: 40%;
  animation: scan 8s linear infinite;
  opacity: 0.6;
}

@keyframes scan {
  0% {
    transform: translateY(-100%);
  }
  100% {
    transform: translateY(250%);
  }
}

.hero-image {
  width: 240px;
  max-width: 60%;
  object-fit: cover;
  border-radius: 4px;
  border: 8px solid #fff;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
  transform: rotate(-4deg);
  margin-bottom: 24px;
  display: none;
  position: relative;
  z-index: 1;
}

.hero-image.visible {
  display: block;
}

.hero-content {
  position: relative;
  z-index: 1;
}

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px 8px 12px;
  border-radius: 999px;
  border: 1px dashed var(--accent-2);
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 22px;
  background-color: rgba(241, 7, 163, 0.08);
}

.kicker-icon {
  width: 16px;
  height: 16px;
  color: var(--accent-2);
  flex-shrink: 0;
}

.hero h1 {
  font-size: clamp(36px, 7vw, 62px);
  font-weight: 800;
  margin: 0 0 18px;
  line-height: 1.05;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #ffffff 40%, var(--accent-2) 120%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 22px;
  color: var(--text-dim);
  font-size: 15px;
}

.hero-meta span {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hero-meta svg {
  width: 18px;
  height: 18px;
  color: var(--accent-2);
  flex-shrink: 0;
}

.description {
  color: var(--text-dim);
  font-size: 16px;
  line-height: 1.65;
  max-width: 620px;
  margin: 0 0 22px;
}

/* Poster section */

.poster-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: 24px;
  margin: 20px 0 32px;
  position: relative;
  z-index: 1;
  align-items: stretch;
}

.poster-frame {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background-color: var(--card-alt);
  box-shadow: 0 20px 50px -25px rgba(0, 0, 0, 0.6);
}

.poster-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.poster-side {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.detail-card {
  background-color: rgba(24, 16, 34, 0.6);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 20px;
  transition: transform 0.3s var(--ease-out), border-color 0.3s ease;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.detail-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent-1);
}

.detail-card svg {
  width: 24px;
  height: 24px;
  color: var(--accent-2);
  margin-bottom: 12px;
}

.detail-card h3 {
  font-size: 15px;
  margin: 0 0 8px;
  font-weight: 600;
  color: var(--text);
}

.detail-card p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.55;
  margin: 0;
}

.instagram-card {
  text-decoration: none;
  cursor: pointer;
}

.instagram-card p {
  color: var(--accent-2);
  font-weight: 600;
  font-size: 14px;
}

/* Card / ticket card */

.card {
  background-color: rgba(24, 16, 34, 0.65);
  backdrop-filter: blur(18px) saturate(160%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  margin: 28px 0;
  position: relative;
}

.ticket-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  overflow: hidden;
  transition: transform 0.3s var(--ease-out), box-shadow 0.3s ease;
}

.ticket-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 50px -20px rgba(123, 47, 247, 0.4);
}

.ticket-card-glow {
  position: absolute;
  top: -60%;
  left: -20%;
  width: 60%;
  height: 220%;
  background: radial-gradient(circle, rgba(123, 47, 247, 0.35), transparent 70%);
  pointer-events: none;
  z-index: 0;
  animation: glowDrift 12s ease-in-out infinite;
}

@keyframes glowDrift {
  0%,
  100% {
    transform: translate(0, 0);
  }
  50% {
    transform: translate(30%, 20%);
  }
}

.ticket-card > * {
  position: relative;
  z-index: 1;
}

.ticket-price {
  font-size: 36px;
  font-weight: 700;
  font-family: var(--font-display);
}

.ticket-price small {
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 400;
  font-family: var(--font-body);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  background-color: var(--card-alt);
  color: var(--text-dim);
  border: 1px solid var(--border);
}

.badge.low {
  color: #ffd166;
  border-color: #ffd166;
}

.badge.sold-out {
  color: var(--danger);
  border-color: var(--danger);
}

.badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--success);
  animation: pulseDot 2s ease-in-out infinite;
}

@keyframes pulseDot {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(35, 196, 122, 0.5);
  }
  50% {
    box-shadow: 0 0 0 4px rgba(35, 196, 122, 0);
  }
}

.badge.low .badge-dot {
  background-color: #ffd166;
}

.badge.sold-out .badge-dot {
  background-color: var(--danger);
  animation: none;
}

.stepper {
  display: flex;
  align-items: center;
  gap: 14px;
  background-color: var(--card-alt);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
}

.stepper button {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--gradient);
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
  transition: transform 0.15s ease;
}

.stepper button:hover:not(:disabled) {
  transform: scale(1.08);
}

.stepper button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.stepper span {
  min-width: 24px;
  text-align: center;
  font-weight: 600;
  font-size: 16px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 15px 26px;
  border-radius: var(--radius-sm);
  border: none;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2), var(--accent-1));
  background-size: 200% 200%;
  color: #fff;
  transition: transform 0.15s ease, opacity 0.15s ease, box-shadow 0.25s ease, background-position 0.6s ease;
  width: 100%;
  position: relative;
  overflow: hidden;
}

.btn > span {
  position: relative;
  z-index: 1;
}

.btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: -60%;
  width: 40%;
  height: 100%;
  background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.35), transparent);
  transform: skewX(-20deg);
  transition: left 0.6s ease;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 30px -8px rgba(241, 7, 163, 0.5);
  background-position: 100% 50%;
}

.btn:hover::before {
  left: 140%;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-secondary {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
}

.btn-secondary::before {
  display: none;
}

.btn-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 220px;
}

.footer {
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  padding: 40px 0;
}

/* Modal */

.modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(5, 2, 10, 0.7);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 50;
}

.modal-overlay.open {
  display: flex;
}

.modal {
  background-color: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  max-width: 480px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
}

.modal h2 {
  margin: 0 0 8px;
  font-size: 22px;
}

.modal p.subtitle {
  color: var(--text-muted);
  font-size: 14px;
  margin: 0 0 24px;
}

.modal-step {
  display: none;
}

.modal-step.active {
  display: block;
}

.field {
  margin-bottom: 18px;
}

.field label {
  display: block;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.field input {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background-color: var(--card-alt);
  color: var(--text);
  font-size: 15px;
  font-family: var(--font-body);
}

.field input:focus {
  outline: none;
  border-color: var(--accent-1);
}

.field input.code-input {
  letter-spacing: 8px;
  font-size: 22px;
  text-align: center;
}

.error-msg {
  color: var(--danger);
  font-size: 13px;
  margin: -6px 0 14px;
  min-height: 16px;
}

.resend-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: -6px 0 18px;
  font-size: 13px;
  color: var(--text-muted);
}

.resend-row button {
  background: none;
  border: none;
  color: var(--accent-2);
  cursor: pointer;
  font-size: 13px;
  padding: 0;
}

.resend-row button:disabled {
  color: var(--text-muted);
  cursor: not-allowed;
}

.order-summary {
  background-color: var(--card-alt);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  margin-bottom: 20px;
  font-size: 14px;
}

.order-summary-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  color: var(--text-dim);
}

.order-summary-row.total {
  border-top: 1px solid var(--border);
  margin-top: 6px;
  padding-top: 12px;
  color: var(--text);
  font-weight: 700;
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: none;
}

.spinner.visible {
  display: inline-block;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.status-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.status-card {
  max-width: 460px;
  text-align: center;
}

.status-icon {
  font-size: 48px;
  margin-bottom: 12px;
}

.payment-widget-wrap {
  border-radius: var(--radius-sm);
  overflow: hidden;
  background-color: #fff;
  margin-bottom: 12px;
}

.payment-widget-wrap.hidden {
  display: none;
}

.result-panel {
  display: none;
  text-align: center;
  padding: 28px 0 12px;
}

.result-panel.visible {
  display: block;
}

.result-panel p {
  color: var(--text-dim);
  font-size: 15px;
  line-height: 1.5;
  margin: 0;
}

.fallback-link {
  text-align: center;
  font-size: 12px;
  margin: 0 0 16px;
}

.fallback-link a {
  color: var(--text-muted);
}

.fallback-link.hidden {
  display: none;
}

@media (max-width: 900px) {
  .poster-section {
    grid-template-columns: 1fr;
  }

  .poster-frame {
    max-height: 480px;
  }
}

@media (max-width: 600px) {
  .ticket-card {
    flex-direction: column;
    align-items: stretch;
  }

  .btn-row {
    min-width: 0;
  }

  .hero-bg {
    inset: -40px -20px;
  }

  .sunburst {
    width: 500px;
    height: 500px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .reveal-in {
    animation-duration: 0.01s;
  }

  .reveal {
    transition-duration: 0.01s;
  }

  .brand-mark,
  .blob,
  .sunburst,
  .scanline,
  .badge-dot,
  .ticket-card-glow {
    animation: none !important;
  }

  .btn::before {
    display: none;
  }

  .detail-card:hover,
  .ticket-card:hover {
    transform: none;
  }
}
