/* ====================================================
   Akanksha Prank Campaign — style.css
   Instagram-inspired premium glassmorphism theme
==================================================== */

/* ---------- Design tokens ---------- */
:root {
  --bg: #0f0f10;
  --text: #f5f5f7;
  --text-dim: rgba(245, 245, 247, 0.62);
  --glass: rgba(255, 255, 255, 0.06);
  --glass-border: rgba(255, 255, 255, 0.12);
  --ig-pink: #e1306c;
  --ig-purple: #833ab4;
  --ig-orange: #f77737;
  --ig-yellow: #fcaf45;
  --ig-gradient: linear-gradient(45deg, #833ab4, #e1306c, #f77737, #fcaf45);
  --radius: 24px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --shadow-soft: 0 10px 40px rgba(0, 0, 0, 0.45);
}

/* ---------- Reset & base ---------- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  display: block;
}

button {
  font: inherit;
  cursor: pointer;
  border: none;
}

/* ====================================================
   PRELOADER
==================================================== */
.preloader {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  transition: opacity 0.6s var(--ease), visibility 0.6s;
}

.preloader.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.preloader-ring {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  padding: 3px;
  background: var(--ig-gradient);
  animation: spin 1.1s linear infinite;
  /* punch a hole in the middle so it reads as a ring */
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 calc(100% - 4px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 calc(100% - 4px));
}

.preloader-text {
  color: var(--text-dim);
  font-size: 0.9rem;
  letter-spacing: 0.06em;
}

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

/* ====================================================
   BACKGROUND — blobs + particle canvas
==================================================== */
.bg-blobs {
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  pointer-events: none;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.35;
  will-change: transform;
  animation: float 18s var(--ease) infinite alternate;
}

.blob-1 {
  width: 45vmax; height: 45vmax;
  top: -15%; left: -10%;
  background: radial-gradient(circle, var(--ig-purple), transparent 70%);
}

.blob-2 {
  width: 40vmax; height: 40vmax;
  bottom: -20%; right: -10%;
  background: radial-gradient(circle, var(--ig-pink), transparent 70%);
  animation-delay: -6s;
}

.blob-3 {
  width: 30vmax; height: 30vmax;
  top: 40%; left: 55%;
  background: radial-gradient(circle, var(--ig-orange), transparent 70%);
  animation-delay: -12s;
  opacity: 0.22;
}

.blob-4 {
  width: 25vmax; height: 25vmax;
  top: 60%; left: -5%;
  background: radial-gradient(circle, var(--ig-yellow), transparent 70%);
  animation-delay: -3s;
  opacity: 0.15;
}

@keyframes float {
  0%   { transform: translate(0, 0) scale(1); }
  50%  { transform: translate(4vmax, -3vmax) scale(1.08); }
  100% { transform: translate(-3vmax, 3vmax) scale(0.95); }
}

#particles {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

/* ====================================================
   LAYOUT
==================================================== */
.page {
  max-width: 520px;
  margin: 0 auto;
  padding: 48px 20px 64px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
}

.page.hiding {
  opacity: 0;
  transform: translateY(-16px) scale(0.98);
  pointer-events: none;
}

/* Fade-in sections (staggered by JS via --delay) */
.fade-section {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
  transition-delay: var(--delay, 0s);
}

.fade-section.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ====================================================
   GLASS CARDS
==================================================== */
.glass-card {
  position: relative;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 24px;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

/* Subtle top "glass reflection" highlight */
.glass-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 55%;
  background: linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.07),
    transparent
  );
  border-radius: var(--radius) var(--radius) 0 0;
  pointer-events: none;
}

.card-title {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ====================================================
   HERO
==================================================== */
.hero {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

/* Instagram-style story ring around the profile photo */
.story-ring {
  width: 148px;
  height: 148px;
  border-radius: 50%;
  padding: 4px;
  background: var(--ig-gradient);
  background-size: 300% 300%;
  animation: ring-shift 6s var(--ease) infinite,
    ring-glow 3s ease-in-out infinite alternate;
}

.story-ring.small {
  width: 110px;
  height: 110px;
}

.story-ring-inner {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  padding: 4px;
  background: var(--bg);
}

.profile-pic {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

@keyframes ring-shift {
  0%, 100% { background-position: 0% 50%; }
  50%      { background-position: 100% 50%; }
}

@keyframes ring-glow {
  from { box-shadow: 0 0 24px rgba(225, 48, 108, 0.35); }
  to   { box-shadow: 0 0 44px rgba(131, 58, 180, 0.55); }
}

.hero-title {
  font-size: clamp(1.5rem, 5.5vw, 2rem);
  line-height: 1.25;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.hero-star {
  display: inline-block;
  animation: star-twinkle 2.4s ease-in-out infinite;
}

@keyframes star-twinkle {
  0%, 100% { transform: scale(1) rotate(0deg); }
  50%      { transform: scale(1.15) rotate(8deg); }
}

.gradient-text {
  background: var(--ig-gradient);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.hero-sub {
  color: var(--text-dim);
  font-size: 0.95rem;
  line-height: 1.65;
  max-width: 42ch;
}

.student-badge {
  margin-top: 16px;
  padding: 14px 20px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.badge-line {
  font-size: 0.85rem;
  color: var(--text-dim);
  letter-spacing: 0.02em;
}

/* ====================================================
   STATS CARD
==================================================== */
.stats-card {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 8px;
  text-align: center;
}

.stat {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
}

.stat-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
}

.stat-value {
  font-size: 1.3rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.countdown {
  font-size: 1.1rem;
  color: var(--ig-yellow);
}

.stat-divider {
  width: 1px;
  background: var(--glass-border);
}

/* ====================================================
   PROGRESS CARD
==================================================== */
.progress-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 14px;
}

.progress-percent {
  font-size: 1.4rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.progress-track {
  height: 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: var(--ig-gradient);
  background-size: 200% auto;
  position: relative;
  transition: width 2s var(--ease);
  animation: ring-shift 4s linear infinite;
}

/* moving shimmer across the fill */
.progress-fill::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    100deg,
    transparent 30%,
    rgba(255, 255, 255, 0.45) 50%,
    transparent 70%
  );
  transform: translateX(-100%);
  animation: shimmer 2.4s var(--ease) infinite;
}

@keyframes shimmer {
  to { transform: translateX(100%); }
}

.progress-meta {
  margin-top: 12px;
  font-size: 0.85rem;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}

/* ====================================================
   SUPPORTERS CARD
==================================================== */
.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.6);
  animation: pulse-dot 1.8s infinite;
}

@keyframes pulse-dot {
  70%  { box-shadow: 0 0 0 9px rgba(74, 222, 128, 0); }
  100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); }
}

.supporter-list {
  list-style: none;
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.supporter {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  transition: opacity 0.45s var(--ease), transform 0.45s var(--ease);
}

.supporter.swapping {
  opacity: 0;
  transform: translateX(14px);
}

.supporter-avatar {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: #fff;
  background: var(--ig-gradient);
}

.supporter-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.supporter-name {
  font-size: 0.9rem;
  font-weight: 600;
}

.supporter-city {
  font-size: 0.75rem;
  color: var(--text-dim);
}

.supporter-heart {
  margin-left: auto;
  font-size: 0.9rem;
  opacity: 0.85;
}

/* ====================================================
   BUTTONS
==================================================== */
.cta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-top: 6px;
}

.btn {
  position: relative;
  overflow: hidden;
  color: #fff;
  font-weight: 700;
  font-size: 1.05rem;
  padding: 17px 42px;
  border-radius: 999px;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
  -webkit-tap-highlight-color: transparent;
}

.btn-primary {
  background: var(--ig-gradient);
  background-size: 200% auto;
  box-shadow: 0 8px 30px rgba(225, 48, 108, 0.4);
  animation: ring-shift 5s linear infinite;
}

.btn-primary:hover {
  transform: scale(1.05);
  box-shadow: 0 12px 42px rgba(225, 48, 108, 0.55);
}

.btn-primary:active {
  transform: scale(0.97);
}

.btn-ghost {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.btn-ghost:hover {
  transform: scale(1.05);
  background: rgba(255, 255, 255, 0.12);
}

/* Subtle heartbeat on the main CTA */
.heartbeat {
  animation: ring-shift 5s linear infinite, heartbeat 2.6s var(--ease) infinite;
}

@keyframes heartbeat {
  0%, 28%, 100% { transform: scale(1); }
  10%           { transform: scale(1.045); }
  18%           { transform: scale(1); }
  24%           { transform: scale(1.03); }
}

.heartbeat:hover {
  animation-play-state: running, paused;
  transform: scale(1.05);
}

/* Ripple effect (span injected by JS) */
.ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.45);
  transform: scale(0);
  animation: ripple 0.65s var(--ease) forwards;
  pointer-events: none;
}

@keyframes ripple {
  to { transform: scale(3.4); opacity: 0; }
}

.cta-note {
  font-size: 0.75rem;
  color: var(--text-dim);
  letter-spacing: 0.03em;
}

/* ====================================================
   OVERLAYS (loading + reveal)
==================================================== */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  transition: opacity 0.6s var(--ease);
}

.overlay.visible {
  opacity: 1;
}

.overlay[hidden] {
  display: none;
}

/* ---------- Loading screen ---------- */
.loading-card {
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  padding: 36px 28px;
  text-align: center;
}

.loading-spinner {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: var(--ig-gradient);
  animation: spin 1s linear infinite;
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 calc(100% - 4px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 calc(100% - 4px));
}

.loading-title {
  font-size: 1.15rem;
  font-weight: 700;
}

/* shimmer sweep over the loading title */
.shimmer-text {
  background: linear-gradient(
    100deg,
    var(--text) 40%,
    var(--ig-yellow) 50%,
    var(--text) 60%
  );
  background-size: 250% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  animation: text-shimmer 2s linear infinite;
}

@keyframes text-shimmer {
  to { background-position: -250% center; }
}

.loading-track {
  width: 100%;
  height: 10px;
}

.loading-track .progress-fill {
  transition: width 0.7s var(--ease);
}

.loading-steps {
  list-style: none;
  width: 100%;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 128px;
}

.loading-step {
  font-size: 0.92rem;
  color: var(--text-dim);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease),
    color 0.5s var(--ease);
}

.loading-step.shown {
  opacity: 1;
  transform: translateY(0);
  color: #4ade80;
}

/* ---------- Reveal screen ---------- */
.reveal-screen {
  overflow-y: auto;
}

#confetti {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 51;
}

.reveal-card {
  width: 100%;
  max-width: 460px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 36px 28px;
  text-align: center;
  z-index: 52;
  transform: scale(0.85);
  opacity: 0;
  transition: transform 0.7s var(--ease), opacity 0.7s var(--ease);
}

.overlay.visible .reveal-card {
  transform: scale(1);
  opacity: 1;
}

.reveal-title {
  font-size: clamp(2.2rem, 9vw, 3rem);
  font-weight: 900;
  letter-spacing: -0.03em;
  animation: pop-in 0.7s var(--ease) both 0.35s;
}

@keyframes pop-in {
  0%   { transform: scale(0.4); opacity: 0; }
  70%  { transform: scale(1.12); }
  100% { transform: scale(1); opacity: 1; }
}

.reveal-subtitle {
  font-size: 1.25rem;
  font-weight: 800;
}

.reveal-body {
  color: var(--text-dim);
  font-size: 0.95rem;
  line-height: 1.6;
}

.reveal-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 10px;
}

.reveal-buttons .btn {
  font-size: 0.95rem;
  padding: 14px 28px;
}

/* ====================================================
   TOASTS
==================================================== */
.toast-container {
  position: fixed;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 300;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  pointer-events: none;
}

.toast {
  background: rgba(28, 28, 32, 0.85);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 12px 22px;
  border-radius: 999px;
  box-shadow: var(--shadow-soft);
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.45s var(--ease), transform 0.45s var(--ease);
}

.toast.shown {
  opacity: 1;
  transform: translateY(0);
}

/* ====================================================
   RESPONSIVE — larger screens
==================================================== */
@media (min-width: 640px) {
  .page {
    padding-top: 72px;
  }

  .story-ring {
    width: 168px;
    height: 168px;
  }

  .stat-value {
    font-size: 1.5rem;
  }

  .countdown {
    font-size: 1.25rem;
  }
}

/* ====================================================
   REDUCED MOTION
==================================================== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.15s !important;
  }

  .fade-section {
    opacity: 1;
    transform: none;
  }

  .blob,
  #particles {
    display: none;
  }
}
