:root {
  /* Midnight palette — tinted darks, never pure black */
  --bg-deep: #070a14;
  --bg-mid: #0c1326;
  --bg-soft: #121d3a;
  --ink: #eaf0ff;
  --ink-dim: #8d9ac4;
  --accent: #2c5dd6;     /* matches the navy of the QR */
  --accent-soft: #4f7ce8;
  --card: #f6f8ff;        /* light plate so the QR stays scannable */

  --r-card: 28px;
  --r-qr: 18px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  min-height: 100svh;
  background:
    radial-gradient(1200px 800px at 50% 18%, var(--bg-soft) 0%, transparent 60%),
    radial-gradient(900px 700px at 80% 90%, #0e1830 0%, transparent 55%),
    linear-gradient(160deg, var(--bg-mid) 0%, var(--bg-deep) 100%);
  color: var(--ink);
  font-family: "Sora", ui-sans-serif, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow: hidden;
}

/* ---- Ripple canvas ---- */
#ripple {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 0;
  pointer-events: none;
}

/* ---- Grain overlay ---- */
.grain {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---- Layout stage: perfect centering on every screen ---- */
.stage {
  position: relative;
  z-index: 2;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: clamp(1.25rem, 4vw, 3rem);
}

.card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(1.4rem, 3.5vw, 2.4rem);
  animation: rise 1s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* ---- QR plate with soft glow + shadow ---- */
.qr-frame {
  position: relative;
  width: clamp(220px, 62vw, 360px);
  aspect-ratio: 1 / 1;
  padding: clamp(16px, 4vw, 26px);
  border-radius: var(--r-card);
  background: var(--card);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.6) inset,
    0 30px 60px -20px rgba(5, 9, 20, 0.8),
    0 10px 24px -12px rgba(0, 0, 0, 0.6);
  isolation: isolate;
}

/* Soft, desaturated halo behind the plate — atmospheric, not neon */
.qr-aura {
  position: absolute;
  inset: -14%;
  z-index: -1;
  border-radius: 40px;
  background: radial-gradient(
    closest-side,
    rgba(79, 124, 232, 0.45),
    rgba(44, 93, 214, 0.18) 55%,
    transparent 75%
  );
  filter: blur(26px);
  animation: breathe 6s ease-in-out infinite;
}

.qr {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: var(--r-qr);
  image-rendering: -webkit-optimize-contrast;
}

/* ---- Tagline ---- */
.tagline {
  display: inline-flex;
  align-items: center;
  gap: 0.7em;
  font-size: clamp(0.95rem, 2.4vw, 1.1rem);
  font-weight: 400;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--ink-dim);
  padding-left: 0.34em; /* optical balance for tracking */
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-soft);
  box-shadow: 0 0 12px rgba(79, 124, 232, 0.9);
  animation: pulse 2.6s ease-in-out infinite;
}

/* ---- Motion ---- */
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(22px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes breathe {
  0%, 100% { opacity: 0.75; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.05); }
}

@keyframes pulse {
  0%, 100% { opacity: 0.5; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.35); }
}

@media (prefers-reduced-motion: reduce) {
  .card,
  .qr-aura,
  .dot {
    animation: none;
  }
}

/* Generous tap/landscape comfort on short screens */
@media (max-height: 520px) {
  .qr-frame {
    width: clamp(180px, 40vh, 280px);
  }
}
