/* ========== Quby — Soft Heaven Palette ========== */
:root {
  /* Base */
  --cloud-white: #FCFCFF;
  --pearl: #F4F6FB;
  --soft-gray: #E8ECF4;
  /* Accent */
  --blush: #FFDCE8;
  --halo-gold: #FFF6CC;
  --lilac-mist: #EEE9FF;
  --mint-glow: #E6FFF6;
  /* Glow */
  --glow-soft: rgba(255, 230, 255, 0.35);
  --glow-secondary: rgba(220, 240, 255, 0.25);
  /* Dark (no harsh black) */
  --dark: #4B4F5C;
  /* Section */
  --section-padding: 120px;
  --max-width: 1100px;
  /* Transitions */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --duration: 0.5s;
}

/* ========== Reset & Base ========== */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'Nunito', -apple-system, sans-serif;
  background: var(--cloud-white);
  color: var(--dark);
  line-height: 1.6;
  letter-spacing: 0.01em;
  overflow-x: hidden;
}

/* ========== Typography ========== */
h1, h2, h3, h4 {
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.3;
}
.hero-headline, .section-heading, .card h3, .step-pill h3 {
  text-transform: lowercase;
}

/* ========== Layout ========== */
main { max-width: var(--max-width); margin: 0 auto; padding: 0 24px; }
.section { padding: var(--section-padding) 0; }

/* ========== Header ========== */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 20px 24px;
}
.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--dark);
  text-decoration: none;
  letter-spacing: 1px;
}

/* ========== Parallax Clouds ========== */
.parallax-clouds {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.05;
}
.cloud {
  position: absolute;
  border-radius: 50%;
  background: var(--dark);
}
.cloud-1 { width: 200px; height: 80px; top: 10%; left: 5%; }
.cloud-2 { width: 160px; height: 60px; top: 40%; right: 10%; }
.cloud-3 { width: 180px; height: 70px; bottom: 30%; left: 15%; }
.cloud-4 { width: 140px; height: 55px; bottom: 15%; right: 20%; }

/* ========== Hero ========== */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 140px 24px 80px;
  z-index: 1;
}
.hero-bg {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 60% at 50% 40%, var(--glow-soft) 0%, transparent 60%);
  background-color: var(--cloud-white);
  opacity: 1;
}
.hero-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none;
}
.hero-character {
  position: relative;
  margin-bottom: 24px;
}
.quby-hero {
  display: block;
  width: 280px;
  height: auto;
  position: relative;
  z-index: 2;
  animation: float 7s ease-in-out infinite, heroBlink 8s ease-in-out infinite;
}
@keyframes heroBlink {
  0%, 45%, 55%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.05); }
}
.hero-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: var(--glow-soft);
  filter: blur(40px);
  z-index: 0;
}
.hero-shadow {
  position: absolute;
  bottom: -20px;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 24px;
  background: radial-gradient(ellipse, rgba(75, 79, 92, 0.12) 0%, transparent 70%);
  border-radius: 50%;
  z-index: 1;
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}
.hero-headline {
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--dark);
  margin: 0 0 8px;
  text-align: center;
  animation: headlineGlow 4s ease-in-out infinite;
}
.hero-sub {
  font-size: 1.1rem;
  color: var(--dark);
  opacity: 0.85;
  margin: 0 0 16px;
  animation: subtlePulse 3s ease-in-out infinite;
}
.hero-badge {
  display: inline-block;
  padding: 8px 18px;
  margin-bottom: 40px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--dark);
  background: var(--blush);
  border-radius: 999px;
  letter-spacing: 0.3px;
  box-shadow: 0 4px 16px rgba(255, 220, 232, 0.4);
  animation: badgeGlow 4s ease-in-out infinite;
}
@keyframes badgeGlow {
  0%, 100% { opacity: 0.95; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.02); }
}
@keyframes headlineGlow {
  0%, 100% { opacity: 1; text-shadow: 0 0 0 transparent; }
  50% { opacity: 0.95; text-shadow: 0 0 24px rgba(255, 220, 232, 0.3); }
}
@keyframes subtlePulse {
  0%, 100% { opacity: 0.85; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.02); }
}
.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
}
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 28px;
  border-radius: 999px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  letter-spacing: 0.5px;
  transition: transform var(--duration) var(--ease), box-shadow var(--duration) var(--ease), background var(--duration) var(--ease), border-color var(--duration) var(--ease);
  cursor: pointer;
  border: 2px solid transparent;
}
.btn-primary {
  background: var(--pearl);
  color: var(--dark);
  border-color: var(--pearl);
}
.btn-primary:hover {
  box-shadow: 0 0 24px var(--glow-secondary);
  background: var(--soft-gray);
}
.btn-primary:active { transform: translateY(2px); }
.btn-secondary {
  background: transparent;
  color: var(--dark);
  border-color: var(--soft-gray);
}
.btn-secondary:hover {
  background: var(--blush);
  border-color: var(--blush);
  box-shadow: 0 0 0 1px rgba(255, 220, 232, 0.5);
}
.btn-secondary::before,
.btn-primary::before {
  content: '🪽';
  position: absolute;
  opacity: 0;
  transition: opacity 0.3s var(--ease);
  font-size: 0.9em;
}
.btn-secondary:hover::before { opacity: 0.7; }
.btn-secondary::before { left: 14px; }
.btn-primary::before { right: 14px; }
.btn-secondary::after {
  content: '🪽';
  position: absolute;
  right: 14px;
  opacity: 0;
  transition: opacity 0.3s var(--ease);
  font-size: 0.9em;
  transform: scaleX(-1);
}
.btn-secondary:hover::after { opacity: 0.7; }

/* ========== Divider ========== */
.divider {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}
.divider.feather {
  height: 40px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 8'%3E%3Cpath fill='none' stroke='%234B4F5C' stroke-width='0.5' opacity='0.2' d='M0 4 Q50 0 100 4 T200 4'/%3E%3C/svg%3E") center no-repeat;
  background-size: 120px 8px;
}

/* ========== Section Headings ========== */
.section-heading {
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 700;
  text-align: center;
  margin: 0 0 48px;
  color: var(--dark);
}
.section-heading .halo {
  display: inline-block;
  margin-right: 8px;
  opacity: 0.6;
  font-size: 0.85em;
  animation: haloTwinkle 3s ease-in-out infinite;
}
@keyframes haloTwinkle {
  0%, 100% { opacity: 0.5; transform: scale(1); }
  50% { opacity: 0.9; transform: scale(1.1); }
}

/* ========== About Cards ========== */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}
.card {
  background: var(--cloud-white);
  border-radius: 24px;
  padding: 32px;
  box-shadow: 0 10px 30px rgba(200, 210, 255, 0.15);
  border: 1px solid rgba(232, 236, 244, 0.8);
  transition: transform var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
}
.card:hover {
  transform: translateY(-8px) scale(0.98);
  box-shadow: 0 20px 48px rgba(200, 210, 255, 0.25), 0 0 0 1px var(--glow-secondary);
}
.card-icon {
  margin-bottom: 16px;
}
.card-icon img {
  width: 80px;
  height: 80px;
  object-fit: contain;
  animation: cardIconBounce 2s ease-in-out infinite;
}
.card:hover .card-icon img { animation: cardIconBounce 0.6s ease-in-out infinite; }
@keyframes cardIconBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}
.card h3 {
  font-size: 1.25rem;
  margin: 0 0 8px;
  color: var(--dark);
}
.card p {
  margin: 0;
  color: var(--dark);
  opacity: 0.9;
  font-size: 0.95rem;
}

/* ========== How to Buy ========== */
.steps {
  display: flex;
  flex-direction: column;
  gap: 32px;
  align-items: center;
}
.step {
  display: flex;
  align-items: center;
  gap: 32px;
  width: 100%;
  max-width: 600px;
  opacity: 0.6;
  transition: opacity var(--duration) var(--ease);
}
.step.in-view { opacity: 1; }
.step-quby {
  flex-shrink: 0;
  opacity: 0;
  transform: translateX(-20px);
  transition: opacity var(--duration) var(--ease), transform var(--duration) var(--ease);
}
.step.in-view .step-quby {
  opacity: 1;
  transform: translateX(0);
}
.step-quby img { width: 120px; height: 120px; object-fit: contain; }
.step-pill {
  flex: 1;
  background: var(--pearl);
  border-radius: 24px;
  padding: 28px 32px;
  border: 1px solid rgba(244, 246, 251, 0.8);
  box-shadow: 0 10px 30px rgba(200, 210, 255, 0.1);
  transition: box-shadow var(--duration) var(--ease);
}
.step.in-view .step-pill {
  box-shadow: 0 10px 30px rgba(200, 210, 255, 0.18);
  animation: stepPillGlow 2s ease-in-out infinite;
}
@keyframes stepPillGlow {
  0%, 100% { box-shadow: 0 10px 30px rgba(200, 210, 255, 0.18); }
  50% { box-shadow: 0 14px 36px rgba(200, 210, 255, 0.22); }
}
.step-num {
  display: inline-block;
  width: 36px;
  height: 36px;
  line-height: 36px;
  text-align: center;
  border-radius: 50%;
  background: var(--blush);
  color: var(--dark);
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 12px;
}
.step-icon { font-size: 1.5rem; margin-right: 8px; }
.step-pill h3 { font-size: 1.2rem; margin: 0 0 6px; }
.step-pill p { margin: 0; font-size: 0.95rem; opacity: 0.9; }

/* ========== Gallery ========== */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 24px;
}
.gallery-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: 20px;
  overflow: hidden;
  padding: 0;
  border: none;
  background: var(--pearl);
  cursor: pointer;
  transition: transform var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
}
.gallery-item:hover {
  transform: scale(1.04);
  box-shadow: 0 12px 32px rgba(200, 210, 255, 0.2);
}
.gallery-item::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--blush);
  opacity: 0;
  transition: opacity var(--duration) var(--ease);
}
.gallery-item:hover::after { opacity: 0.25; }
.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.share-hint {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  font-size: 0.85rem;
  color: var(--dark);
  opacity: 0;
  transition: opacity var(--duration) var(--ease), transform var(--duration) var(--ease);
  z-index: 2;
}
.gallery-item:hover .share-hint {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ========== Lightbox ========== */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.lightbox[hidden] { display: none; }
.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(75, 79, 92, 0.4);
  backdrop-filter: blur(8px);
}
.lightbox-close {
  position: absolute;
  top: 24px;
  right: 24px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: var(--cloud-white);
  color: var(--dark);
  font-size: 1.5rem;
  cursor: pointer;
  z-index: 3;
  transition: background var(--duration) var(--ease);
}
.lightbox-close:hover { background: var(--blush); }
.lightbox-content {
  position: relative;
  z-index: 2;
  max-width: 90vw;
  max-height: 85vh;
}
.lightbox-content img {
  max-width: 100%;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.15);
}

/* ========== Falling Qubies (spawned on hero click) ========== */
.falling-qubies {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 50;
  overflow: hidden;
}
.falling-quby {
  position: fixed;
  top: -80px;
  left: 0;
  z-index: 51;
  animation: fallDown linear forwards;
}
.falling-quby img {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 4px 12px rgba(255, 220, 232, 0.3));
}
@keyframes fallDown {
  0% {
    transform: translateY(0) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(calc(100vh + 100px)) rotate(15deg);
    opacity: 0.9;
  }
}

/* ========== Hero Quby (clickable) ========== */
.quby-hero { cursor: pointer; }

/* ========== Sticky Buy (Mobile) ========== */
.sticky-buy-mobile {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 12px 16px;
  background: var(--cloud-white);
  border-top: 1px solid var(--soft-gray);
  z-index: 80;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.06);
}
.sticky-buy-mobile .btn { width: 100%; }

/* ========== Cursor sparkles (container) ========== */
.cursor-sparkles, .click-burst-container {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
}
.sparkle-dot {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--halo-gold);
  opacity: 0;
  animation: sparkleFade 1.2s var(--ease) forwards;
}
.click-particle {
  position: absolute;
  font-size: 1.2rem;
  pointer-events: none;
  animation: floatUp 1.2s var(--ease) forwards;
  opacity: 0.9;
}
@keyframes sparkleFade {
  0% { opacity: 0; transform: scale(0.5); }
  20% { opacity: 0.8; }
  100% { opacity: 0; transform: scale(1) translateY(-20px); }
}
@keyframes floatUp {
  0% { opacity: 0.9; transform: translateY(0) scale(1); }
  100% { opacity: 0; transform: translateY(-80px) scale(1.2); }
}

/* ========== Confetti ========== */
.confetti {
  position: fixed;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  pointer-events: none;
  z-index: 150;
  animation: confettiFall 2s var(--ease) forwards;
}
@keyframes confettiFall {
  0% {
    opacity: 1;
    transform: translateY(0) rotate(0deg);
  }
  100% {
    opacity: 0;
    transform: translateY(-200px) rotate(720deg);
  }
}

/* ========== Count-up (token numbers) ========== */
.count-up { display: inline-block; }

/* ========== Mobile ========== */
@media (max-width: 768px) {
  :root { --section-padding: 80px; }
  .hero { padding: 120px 16px 60px; }
  .quby-hero { width: 220px; }
  .hero-glow { width: 260px; height: 260px; }
  .step { flex-direction: column; text-align: center; }
  .step-quby { order: -1; }
  .sticky-buy-mobile { display: block; }
}

/* Reduce motion / reduce particles for accessibility & mobile */
@media (prefers-reduced-motion: reduce) {
  .parallax-clouds { opacity: 0.02; }
  .quby-hero { animation: none; }
}
