:root {
  --color-bg: #0a0a0f;
  --color-text: #efeff1;
  --color-text-dim: rgba(239, 239, 241, 0.5);
  --neon-primary: #7c5cfc;
  --neon-secondary: #00e5ff;
  --neon-glow: 0 0 8px rgba(124, 92, 252, 0.7),
               0 0 24px rgba(124, 92, 252, 0.35);
  --glass-border: rgba(255, 255, 255, 0.12);
  --glass-bg: rgba(255, 255, 255, 0.04);
  --font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

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

body {
  font-family: var(--font-family);
  background: var(--color-bg);
  color: var(--color-text);
  min-height: 100dvh;
  overflow: hidden;
}

body.intro-done {
  overflow: auto;
}

/* ── Intro overlay ────────────────────────── */

.intro {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 48px;
  background: var(--color-bg);
  transition: opacity 400ms ease;
}

.intro.fade-out {
  opacity: 0;
  pointer-events: none;
}

/* ── Glass card ───────────────────────────── */

.intro__glass-card {
  width: min(82vw, 340px);
  aspect-ratio: 1.586 / 1;
  border-radius: 16px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5),
              inset 0 1px 0 rgba(255, 255, 255, 0.08);
  position: relative;
  overflow: hidden;
  animation: breathe 2s ease-in-out infinite;
  will-change: transform;
}

/* light-reflection stripe */
.intro__glass-card::before {
  content: '';
  position: absolute;
  top: -40%;
  left: -10%;
  width: 60%;
  height: 180%;
  background: linear-gradient(
    105deg,
    transparent 40%,
    rgba(255, 255, 255, 0.06) 45%,
    rgba(255, 255, 255, 0.12) 50%,
    rgba(255, 255, 255, 0.06) 55%,
    transparent 60%
  );
  transform: rotate(25deg);
  pointer-events: none;
}

.glass-card__chip {
  position: absolute;
  top: 28%;
  left: 10%;
  width: 44px;
  height: 32px;
  border-radius: 6px;
  background: linear-gradient(135deg, #d4a853 0%, #b8862d 100%);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.15);
}

.glass-card__chip::after {
  content: '';
  position: absolute;
  inset: 4px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 3px;
}

.glass-card__contactless {
  position: absolute;
  top: 26%;
  right: 12%;
  font-size: 26px;
  color: rgba(255, 255, 255, 0.25);
  transform: rotate(90deg);
}

.glass-card__label {
  position: absolute;
  bottom: 22%;
  right: 12%;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--color-text-dim);
}

.glass-card__name {
  position: absolute;
  bottom: 14%;
  left: 10%;
  font-size: clamp(1rem, 4.5vw, 1.25rem);
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--color-text);
  text-transform: uppercase;
}

/* Phase 2: flip & fly away */
.intro__glass-card.flip-away {
  animation: flipAway 500ms cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes breathe {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-10px); }
}

@keyframes flipAway {
  0%   { transform: translateY(0) rotateX(0deg)    scale(1);    opacity: 1; }
  40%  { transform: translateY(-20px) rotateX(-25deg) scale(1.05); opacity: 1; }
  100% { transform: translateY(-120vh) rotateX(-60deg) scale(0.7);  opacity: 0; }
}

/* ── Progress bar ─────────────────────────── */

.intro__progress {
  width: min(72vw, 280px);
}

.progress__track {
  width: 100%;
  height: 3px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  position: relative;
}

.progress__fill {
  width: 0%;
  height: 100%;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--neon-primary), var(--neon-secondary));
  box-shadow: var(--neon-glow);
  transition: none;
}

.progress__fill.animate {
  animation: fillBar 1000ms cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

@keyframes fillBar {
  0%   { width: 0%; }
  15%  { width: 22%; }
  40%  { width: 55%; }
  70%  { width: 78%; }
  100% { width: 100%; }
}

/* ── Main app ─────────────────────────────── */

.app {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 500ms ease, transform 500ms ease;
}

.app.visible {
  opacity: 1;
  transform: translateY(0);
}

.app__placeholder {
  font-size: clamp(1rem, 5vw, 1.5rem);
  color: var(--color-text-dim);
  text-align: center;
  padding: 24px;
  border: 1px dashed rgba(255, 255, 255, 0.1);
  border-radius: 12px;
}

/* ── Larger screens ───────────────────────── */

@media (min-width: 600px) {
  .intro { gap: 64px; }

  .intro__glass-card {
    width: 360px;
  }

  .intro__progress {
    width: 300px;
  }

  .progress__track {
    height: 4px;
  }
}
