/* ==========================================================================
   vcard.virtualgraf.es — tarjeta digital de Álvaro Ruiz (VirtualGraf)
   Tema cinematográfico: negro OLED + azul de marca + motivo de lente.
   Solo transform/opacity para animar (compositor). Respeta reduced-motion.
   ========================================================================== */

@font-face {
  font-family: 'Inter';
  src: url('../fonts/inter-var.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg:        #05070d;
  --ink:       #eaf1fa;
  --muted:     #94a7be;
  --blue:      #2487d4;
  --blue-lo:   #1567b8;
  --blue-hi:   #63bbfb;
  --red:       #ff3b4e;
  --glass:     rgba(255,255,255,.055);
  --glass-2:   rgba(255,255,255,.08);
  --brd:       rgba(255,255,255,.10);
  --brd-2:     rgba(255,255,255,.16);
  --radius:    20px;
  --shadow:    0 18px 50px rgba(0,0,0,.55);
  --glow:      0 0 0 1px rgba(36,135,212,.35), 0 12px 34px -8px rgba(36,135,212,.55);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* ---------- Fondo cinematográfico ---------- */
.scene { position: fixed; inset: 0; z-index: -2; overflow: hidden; background:
    radial-gradient(120% 90% at 50% -10%, #0b1c31 0%, #070c15 45%, #04060b 100%); }
.scene .blob {
  position: absolute; width: 60vmax; height: 60vmax; border-radius: 50%;
  filter: none; opacity: .55; will-change: transform;
  background: radial-gradient(closest-side, rgba(36,135,212,.55), rgba(36,135,212,0) 70%);
}
.scene .b1 { top: -22vmax; left: -14vmax; animation: drift1 26s ease-in-out infinite; }
.scene .b2 { bottom: -26vmax; right: -18vmax; opacity: .40;
  background: radial-gradient(closest-side, rgba(99,187,251,.42), rgba(99,187,251,0) 70%);
  animation: drift2 32s ease-in-out infinite; }
.scene .b3 { top: 30%; right: -20vmax; width: 44vmax; height: 44vmax; opacity: .28;
  background: radial-gradient(closest-side, rgba(21,103,184,.5), rgba(21,103,184,0) 70%);
  animation: drift3 38s ease-in-out infinite; }

/* Aros de apertura (lente) girando muy lento */
.scene .rings { position: absolute; top: 50%; left: 50%; width: 128vmax; height: 128vmax;
  transform: translate(-50%,-50%); opacity: .16; will-change: transform;
  animation: spin 90s linear infinite; }
.scene .rings::before, .scene .rings::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  border: 1px solid rgba(99,187,251,.35); }
.scene .rings::after { inset: 16vmax; border-color: rgba(99,187,251,.22); }
.scene .ring2 { position: absolute; top: 50%; left: 50%; width: 82vmax; height: 82vmax;
  transform: translate(-50%,-50%); border-radius: 50%;
  border: 1px dashed rgba(99,187,251,.18); opacity: .5;
  animation: spin-rev 70s linear infinite; }

/* Grano de cine */
.grain { position: fixed; inset: -50%; z-index: -1; pointer-events: none; opacity: .05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 6s steps(6) infinite; will-change: transform; }
/* Viñeta */
.vignette { position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(120% 100% at 50% 30%, transparent 55%, rgba(0,0,0,.55) 100%); }

@keyframes drift1 { 0%,100%{transform:translate(0,0) scale(1)} 50%{transform:translate(6vmax,4vmax) scale(1.08)} }
@keyframes drift2 { 0%,100%{transform:translate(0,0) scale(1)} 50%{transform:translate(-5vmax,-3vmax) scale(1.12)} }
@keyframes drift3 { 0%,100%{transform:translate(0,0) scale(1)} 50%{transform:translate(-4vmax,5vmax) scale(1.06)} }
@keyframes spin { to { transform: translate(-50%,-50%) rotate(360deg); } }
@keyframes spin-rev { to { transform: translate(-50%,-50%) rotate(-360deg); } }
@keyframes grain { 0%{transform:translate(0,0)} 25%{transform:translate(-4%,3%)} 50%{transform:translate(3%,-2%)} 75%{transform:translate(-2%,-3%)} 100%{transform:translate(2%,2%)} }

/* ---------- Layout ---------- */
.wrap { width: 100%; max-width: 480px; margin: 0 auto;
  padding: max(34px, env(safe-area-inset-top)) 20px max(26px, env(safe-area-inset-bottom));
  display: flex; flex-direction: column; min-height: 100dvh; }

/* ---------- Tarjeta ---------- */
.card { animation: rise .7s cubic-bezier(.16,1,.3,1) both; }
.card-head { text-align: center; }

.avatar { position: relative; width: 108px; height: 108px; margin: 4px auto 18px;
  display: grid; place-items: center; }
.avatar .halo { position: absolute; inset: -6px; border-radius: 50%;
  background: conic-gradient(from 0deg, var(--blue-hi), var(--blue-lo), var(--blue), var(--blue-hi));
  opacity: .9; filter: blur(.5px); animation: spin 12s linear infinite; }
.avatar .disc { position: absolute; inset: 3px; border-radius: 50%;
  background: radial-gradient(120% 120% at 30% 20%, #123253, #0a1b2e 60%, #050c16);
  border: 1px solid var(--brd-2); box-shadow: inset 0 1px 0 rgba(255,255,255,.12); }
.avatar .disc img { position: absolute; inset: 22%; width: 56%; height: 56%; }
.avatar .disc img.photo { inset: 0; width: 100%; height: 100%; object-fit: cover;
  border-radius: 50%; filter: saturate(1.02) contrast(1.02); }
.avatar .pulse { position: absolute; inset: 3px; border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(36,135,212,.5); animation: pulse 3.4s ease-out infinite; }
@keyframes pulse { 0%{box-shadow:0 0 0 0 rgba(36,135,212,.45)} 70%,100%{box-shadow:0 0 0 22px rgba(36,135,212,0)} }

.brand-logo { height: 30px; width: auto; margin: 2px auto 12px; display: block;
  filter: drop-shadow(0 4px 16px rgba(36,135,212,.45)); }

.name { font-size: 25px; font-weight: 800; letter-spacing: -.02em; margin: 0; line-height: 1.15; }
.role { font-size: 14px; font-weight: 600; color: var(--blue-hi); margin: 6px 0 0;
  letter-spacing: .01em; }
.company { font-size: 12.5px; color: var(--muted); margin: 8px 0 0; line-height: 1.5; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 18px 0 4px; }
.chip { display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px;
  font-size: 12px; font-weight: 600; color: #d7e6f6; border-radius: 999px;
  background: var(--glass); border: 1px solid var(--brd); backdrop-filter: blur(8px); }
.chip svg { width: 15px; height: 15px; color: var(--blue-hi); flex: none; }

/* ---------- CTA principal ---------- */
.cta { position: relative; display: flex; align-items: center; justify-content: center;
  gap: 11px; width: 100%; margin: 22px 0 8px; padding: 17px 20px;
  font-family: inherit; font-size: 16px; font-weight: 700; color: #fff; cursor: pointer;
  text-decoration: none; border: 0; border-radius: 16px; overflow: hidden;
  background: linear-gradient(135deg, #38a2f0, var(--blue) 45%, var(--blue-lo));
  box-shadow: var(--glow), inset 0 1px 0 rgba(255,255,255,.25);
  transition: transform .18s cubic-bezier(.16,1,.3,1), box-shadow .25s ease; }
.cta svg { width: 21px; height: 21px; flex: none; }
.cta::after { content: ""; position: absolute; top: 0; left: -60%; width: 45%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.4), transparent);
  transform: skewX(-18deg); animation: sheen 4.5s ease-in-out infinite; }
.cta:hover { transform: translateY(-2px); box-shadow: 0 0 0 1px rgba(99,187,251,.5), 0 20px 44px -10px rgba(36,135,212,.75), inset 0 1px 0 rgba(255,255,255,.3); }
.cta:active { transform: translateY(0) scale(.99); }
@keyframes sheen { 0%,72%{left:-60%} 100%{left:130%} }

/* ---------- Filas de enlace ---------- */
.links { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.row { display: flex; align-items: center; gap: 14px; padding: 13px 14px;
  text-decoration: none; color: var(--ink); border-radius: 15px;
  background: var(--glass); border: 1px solid var(--brd); backdrop-filter: blur(10px);
  transition: transform .16s cubic-bezier(.16,1,.3,1), background .2s, border-color .2s, box-shadow .25s;
  will-change: transform; }
.row:hover { transform: translateY(-2px); background: var(--glass-2); border-color: var(--brd-2);
  box-shadow: 0 12px 30px -12px rgba(36,135,212,.55); }
.row:active { transform: translateY(0) scale(.995); }
.row .ico { flex: none; width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center;
  background: linear-gradient(145deg, rgba(56,162,240,.9), rgba(21,103,184,.85));
  border: 1px solid rgba(255,255,255,.18); box-shadow: inset 0 1px 0 rgba(255,255,255,.25); }
.row .ico svg { width: 21px; height: 21px; color: #fff; }
.row .txt { display: flex; flex-direction: column; min-width: 0; }
.row .lbl { font-size: 14.5px; font-weight: 700; letter-spacing: -.01em; }
.row .sub { font-size: 12px; color: var(--muted); margin-top: 1px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .chev { margin-left: auto; color: var(--muted); flex: none; transition: transform .2s, color .2s; }
.row:hover .chev { transform: translateX(3px); color: var(--blue-hi); }
.row .chev svg { width: 18px; height: 18px; }

/* ---------- Enlace QR ---------- */
.qr-hint { display: inline-flex; align-items: center; gap: 8px; align-self: center;
  margin: 20px auto 4px; padding: 9px 16px; font-size: 13px; font-weight: 600;
  color: var(--blue-hi); text-decoration: none; border-radius: 999px;
  border: 1px solid var(--brd); background: var(--glass); transition: border-color .2s, transform .16s; }
.qr-hint:hover { border-color: var(--brd-2); transform: translateY(-1px); }
.qr-hint svg { width: 17px; height: 17px; }

/* ---------- Footer made with love ---------- */
.made { margin-top: auto; padding-top: 26px; text-align: center; }
.made .line { display: inline-flex; align-items: center; gap: 6px; justify-content: center;
  font-size: 12.5px; font-weight: 600; color: var(--muted); }
.made .heart { width: 15px; height: 15px; color: var(--red); animation: beat 1.25s ease-in-out infinite;
  transform-origin: center; filter: drop-shadow(0 0 6px rgba(255,59,78,.55)); }
.made a { display: inline-flex; align-items: center; text-decoration: none; }
.made .vv { height: 18px; width: auto; opacity: .95; transition: opacity .2s, transform .2s; }
.made a:hover .vv { opacity: 1; transform: translateY(-1px); }
@keyframes beat { 0%,100%{transform:scale(1)} 15%{transform:scale(1.28)} 30%{transform:scale(1)} 45%{transform:scale(1.16)} 60%{transform:scale(1)} }

@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

/* ==========================================================================
   Página QR (/qr)
   ========================================================================== */
.qr-page .wrap { justify-content: center; align-items: center; text-align: center; gap: 4px; }
.qr-brand { height: 26px; width: auto; margin-bottom: 20px;
  filter: drop-shadow(0 4px 16px rgba(36,135,212,.45)); animation: rise .7s cubic-bezier(.16,1,.3,1) both; }
.qr-title { font-size: 20px; font-weight: 800; letter-spacing: -.02em; margin: 0 0 4px;
  animation: rise .7s .05s cubic-bezier(.16,1,.3,1) both; }
.qr-sub { font-size: 13.5px; color: var(--muted); margin: 0 0 26px;
  animation: rise .7s .1s cubic-bezier(.16,1,.3,1) both; }

.qr-stage { position: relative; width: 300px; max-width: 78vw; aspect-ratio: 1;
  display: grid; place-items: center; animation: rise .8s .12s cubic-bezier(.16,1,.3,1) both; }
.qr-stage .lens { position: absolute; inset: -26px; border-radius: 30px;
  border: 1px solid rgba(99,187,251,.35); animation: breathe 4.5s ease-in-out infinite; }
.qr-stage .lens.l2 { inset: -46px; border-radius: 40px; border-color: rgba(99,187,251,.18);
  animation-delay: .4s; }
.qr-float { position: relative; width: 100%; height: 100%; border-radius: 22px;
  background: #fff; padding: 18px; box-shadow: 0 30px 70px -18px rgba(0,0,0,.7), 0 0 0 1px rgba(255,255,255,.12), 0 0 60px -10px rgba(36,135,212,.6);
  animation: bob 6s ease-in-out infinite; will-change: transform; }
.qr-float img.qr { width: 100%; height: 100%; display: block; }
.qr-float .qr-logo { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
  width: 21%; height: 21%; background: #fff; border-radius: 12px; padding: 5px;
  box-shadow: 0 0 0 5px #fff; display: grid; place-items: center; }
.qr-float .qr-logo img { width: 100%; height: 100%; }

.qr-cta { margin-top: 30px; display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 600; color: var(--muted); text-decoration: none;
  padding: 10px 18px; border-radius: 999px; border: 1px solid var(--brd); background: var(--glass);
  transition: color .2s, border-color .2s, transform .16s;
  animation: rise .7s .2s cubic-bezier(.16,1,.3,1) both; }
.qr-cta:hover { color: var(--ink); border-color: var(--brd-2); transform: translateY(-1px); }
.qr-cta svg { width: 16px; height: 16px; }
.qr-page .made { position: fixed; left: 0; right: 0; bottom: max(20px, env(safe-area-inset-bottom)); margin: 0; }

@keyframes bob { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-12px)} }
@keyframes breathe { 0%,100%{transform:scale(1);opacity:.8} 50%{transform:scale(1.05);opacity:1} }

/* ---------- Accesibilidad: sin movimiento ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important;
    transition-duration: .001ms !important; }
  .qr-float, .made .heart, .avatar .halo { animation: none !important; }
}

/* ---------- Pantallas muy pequeñas ---------- */
@media (max-width: 360px) {
  .name { font-size: 22px; }
  .cta { font-size: 15px; padding: 15px; }
  .qr-stage { width: 260px; }
}
