/* Tarjeta de Nico · Kalel. Titanio negro, grabado gris, un acento (azul Kalel). */

@font-face {
  font-family: "Archivo";
  src: url("/assets/fonts/archivo.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-style: normal;
  font-display: swap;
}

:root {
  --negro: #0a0a0b;
  --grafito: #121214;
  --linea: rgba(255, 255, 255, 0.1);
  --plata: #d9d9d6;
  --niebla: #8e8e8a;
  --azul: #4fa3ff;
  --gutter: 20px;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-io: cubic-bezier(0.77, 0, 0.175, 1);
  color-scheme: dark;
}

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

html {
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
  background: var(--negro);
}

body {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background: var(--negro);
  color: var(--plata);
  font-family: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 1rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

svg { fill: currentColor; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

a, button { touch-action: manipulation; }
button, .btn { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

:focus-visible { outline: 2px solid var(--azul); outline-offset: 3px; border-radius: 6px; }

/* ------------------------------------------------------------------ cabecera */
.cab {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(env(safe-area-inset-top, 0px) + 8px) max(var(--gutter), env(safe-area-inset-right, 0px)) 8px max(var(--gutter), env(safe-area-inset-left, 0px));
}
.marca {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  color: var(--plata);
  text-decoration: none;
  font-size: 0.8125rem;
  font-weight: 600;
  font-stretch: 125%;
  letter-spacing: 0.3em;
}
.marca svg { width: 24px; height: 24px; }
.idioma { display: inline-flex; gap: 2px; }
.idioma button {
  min-width: 44px;
  min-height: 44px;
  border-radius: 10px;
  color: var(--niebla);
  font-size: 0.75rem;
  font-weight: 600;
  font-stretch: 125%;
  letter-spacing: 0.12em;
  transition: color 160ms ease, background-color 160ms ease;
}
.idioma button[aria-pressed="true"] { color: var(--plata); background: rgba(255, 255, 255, 0.07); }

/* ------------------------------------------------------------------ hoja */
.hoja {
  flex: 1;
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  display: grid;
  align-content: start;
  gap: 32px;
  padding: 4px var(--gutter) 40px;
  overflow-x: clip;
}

/* ------------------------------------------------------------------ escena y tarjeta */
.escena {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 16px;
  padding-top: 12px;
}
.escena::before {
  content: "";
  position: absolute;
  inset: -12% 0 0;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(48% 46% at 50% 44%, rgba(255, 255, 255, 0.075), transparent 72%);
}

.marco {
  width: min(100%, 420px);
  container-type: inline-size;
  perspective: 1100px;
  animation: entrada 1000ms var(--ease-out) both;
}
@keyframes entrada {
  from { opacity: 0; transform: perspective(900px) translateY(26px) rotateX(18deg) scale(0.96); }
  to { opacity: 1; transform: none; }
}

.tarjeta {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 85.6 / 53.98;
  border-radius: 4.2cqi;
  transform-style: preserve-3d;
  touch-action: pan-y;
  will-change: transform;
}
.tarjeta:focus-visible { outline-offset: 8px; border-radius: 4.2cqi; }

.tarjeta__giro {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  transition: transform 760ms var(--ease-io);
}
.tarjeta[aria-pressed="true"] .tarjeta__giro { transform: rotateY(180deg); }

.cara {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: 4.2cqi;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  transform: rotateY(0deg);
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='t'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.0016 0.62' numOctaves='3' seed='7'/%3E%3CfeColorMatrix values='1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0.1'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23t)'/%3E%3C/svg%3E") 0 0 / 100% 100%,
    radial-gradient(130% 125% at 14% 0%, #19191b 0%, #0d0d0f 48%, #050506 100%);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.07),
    inset 0 1px 0 rgba(255, 255, 255, 0.13),
    inset 0 -1px 0 rgba(0, 0, 0, 0.7),
    0 3cqi 7cqi -2cqi rgba(0, 0, 0, 0.85);
  text-align: left;
  color: #a3a39f;
}
.cara--dorso { transform: rotateY(180deg); }

/* Grabado a láser: gris mate con un filo de luz arriba y sombra abajo. */
.grabado {
  background: linear-gradient(180deg, #d4d4cf 0%, #8f8f8b 58%, #a7a7a2 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 -0.5px 0 rgba(0, 0, 0, 0.9)) drop-shadow(0 0.5px 0 rgba(255, 255, 255, 0.08));
}

/* Luz: la sigue el JS con --lx/--ly; el barrido pasa una vez al entrar y al girar. */
.cara__luz {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(70% 95% at var(--lx, 28%) var(--ly, 12%), rgba(255, 255, 255, 0.085), transparent 62%);
}
.cara__luz::after {
  content: "";
  position: absolute;
  inset: -30% -70%;
  background: linear-gradient(102deg, transparent 42%, rgba(255, 255, 255, 0.05) 47%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.05) 53%, transparent 58%);
  transform: translateX(-62%);
  opacity: 0;
}
.cara--frente .cara__luz::after { animation: barrido 1500ms 520ms var(--ease-io) both; }
.tarjeta.barre .cara__luz::after { animation: barrido 1300ms 260ms var(--ease-io) both; }
@keyframes barrido {
  0% { transform: translateX(-62%); opacity: 0; }
  14% { opacity: 1; }
  86% { opacity: 1; }
  100% { transform: translateX(62%); opacity: 0; }
}

/* Frente */
.emisor {
  position: absolute;
  top: 6.4cqi;
  left: 7cqi;
  display: inline-flex;
  align-items: center;
  gap: 2.2cqi;
  font-size: 3.2cqi;
  font-weight: 600;
  font-stretch: 125%;
  letter-spacing: 0.34em;
  line-height: 1;
}
.emisor svg { width: 6.6cqi; height: 6.6cqi; color: #b4b4af; filter: drop-shadow(0 -0.5px 0 rgba(0, 0, 0, 0.9)); }

.medallon {
  position: absolute;
  top: 6.5cqi;
  right: 1cqi;
  width: 54cqi;
  aspect-ratio: 700 / 600;
  -webkit-mask: url("/assets/img/medallon.svg") center / contain no-repeat;
  mask: url("/assets/img/medallon.svg") center / contain no-repeat;
  background: radial-gradient(60% 70% at var(--mlx, 40%) var(--mly, 30%), rgba(236, 236, 232, 0.5), rgba(160, 160, 156, 0.14) 70%);
  opacity: 0.7;
}

.chip {
  position: absolute;
  top: 22.5cqi;
  left: 7cqi;
  width: 12.4cqi;
  height: 9.4cqi;
  border-radius: 1.7cqi;
  background: linear-gradient(135deg, #6a6a6d 0%, #303033 40%, #57575a 68%, #242426 100%);
  box-shadow: inset 0 0 0 0.3cqi rgba(0, 0, 0, 0.35), inset 0 0.25cqi 0 rgba(255, 255, 255, 0.18);
  overflow: hidden;
}
.chip::before, .chip::after, .chip span {
  content: "";
  position: absolute;
  border: 0 solid rgba(0, 0, 0, 0.5);
}
.chip::before { inset: 0 33%; border-left-width: 0.25cqi; border-right-width: 0.25cqi; }
.chip span { inset: 30% 0; border-top-width: 0.25cqi; border-bottom-width: 0.25cqi; }
.chip::after { inset: 30% 33%; border-width: 0.25cqi; border-radius: 0.8cqi; background: linear-gradient(135deg, #5c5c5f, #39393c); }

.numero {
  position: absolute;
  top: 38cqi;
  left: 7cqi;
  font-size: 5.2cqi;
  font-weight: 430;
  font-stretch: 112%;
  letter-spacing: 0.1em;
  font-variant-numeric: tabular-nums lining-nums;
  line-height: 1;
  white-space: nowrap;
}

.titular {
  position: absolute;
  left: 7cqi;
  right: 7cqi;
  bottom: 6.4cqi;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 4cqi;
  line-height: 1;
}
.titular__nombre { font-size: 3.8cqi; font-weight: 520; font-stretch: 120%; letter-spacing: 0.2em; white-space: nowrap; }
.titular__cargo { font-size: 3.2cqi; font-weight: 600; font-stretch: 125%; letter-spacing: 0.3em; }

/* Dorso */
.banda {
  position: absolute;
  top: 8.5cqi;
  left: 0;
  right: 0;
  height: 12.6cqi;
  background: linear-gradient(180deg, #030304 0%, #141416 46%, #08080a 54%, #020203 100%);
  box-shadow: inset 0 0.3cqi 0 rgba(255, 255, 255, 0.05), inset 0 -0.3cqi 0 rgba(0, 0, 0, 0.6);
}
.dorso__datos {
  position: absolute;
  top: 28cqi;
  left: 7cqi;
  display: grid;
  gap: 1.6cqi;
  font-size: 3.4cqi;
  font-weight: 460;
  font-stretch: 106%;
  letter-spacing: 0.05em;
  line-height: 1.1;
  white-space: nowrap;
}
.dorso__qr {
  position: absolute;
  top: 25.5cqi;
  right: 7cqi;
  width: 24.5cqi;
  aspect-ratio: 1;
  padding: 1.2cqi;
  border-radius: 1.8cqi;
  background: linear-gradient(160deg, #ededea 0%, #c9c9c4 100%);
  box-shadow: inset 0 0.25cqi 0 rgba(255, 255, 255, 0.7), 0 0.4cqi 1.2cqi rgba(0, 0, 0, 0.6);
}
.dorso__qr svg { display: block; width: 100%; height: 100%; }
.dorso__pie {
  position: absolute;
  left: 7cqi;
  right: 7cqi;
  bottom: 5.6cqi;
  font-size: 2.1cqi;
  font-weight: 560;
  font-stretch: 106%;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  line-height: 1;
  white-space: nowrap;
}

.pista { font-size: 0.8125rem; color: var(--niebla); text-align: center; }

/* ------------------------------------------------------------------ ficha */
.ficha { width: 100%; max-width: 440px; justify-self: center; }
.ficha h1 {
  font-size: clamp(2.125rem, 4.2vw + 1rem, 3.25rem);
  font-weight: 300;
  font-stretch: 106%;
  letter-spacing: -0.012em;
  line-height: 1.05;
  color: #ececea;
}
.cargo {
  margin-top: 12px;
  font-size: 0.8125rem;
  font-weight: 560;
  font-stretch: 125%;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--plata);
}
.lema { margin-top: 10px; max-width: 34ch; color: var(--niebla); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: 12px;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 120ms var(--ease-out), background-color 180ms ease, border-color 180ms ease;
}
.btn:active { transform: scale(0.97); }
.btn svg { width: 22px; height: 22px; flex: none; }

.btn--plata {
  margin-top: 28px;
  width: 100%;
  min-height: 56px;
  padding: 0 20px;
  color: #0a0a0b;
  background: linear-gradient(180deg, #efefec 0%, #c6c6c1 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75), inset 0 -1px 0 rgba(0, 0, 0, 0.2), 0 1px 2px rgba(0, 0, 0, 0.6);
  font-size: 1.0625rem;
  font-weight: 620;
  font-stretch: 106%;
}
.btn--plata:focus-visible { outline-offset: 4px; border-radius: 12px; }

.canales { margin-top: 18px; list-style: none; }
.canales li + li { border-top: 1px solid var(--linea); }
.canales a {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 16px;
  min-height: 66px;
  margin: 0 -12px;
  padding: 10px 12px;
  border-radius: 12px;
  color: var(--plata);
  text-decoration: none;
  transition: background-color 160ms ease;
}
.canales a:active { background: rgba(255, 255, 255, 0.05); }
.canales svg { width: 22px; height: 22px; }
.canales .flecha { width: 18px; height: 18px; color: var(--niebla); transition: transform 180ms var(--ease-out), color 180ms ease; }
.canal { display: grid; gap: 1px; min-width: 0; }
.canal__nombre { font-size: 0.875rem; color: var(--niebla); }
.canal__valor { font-size: 1.0625rem; font-stretch: 104%; overflow-wrap: anywhere; }

.secundarias { margin-top: 18px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.btn--linea {
  min-height: 52px;
  padding: 0 14px;
  border: 1px solid var(--linea);
  color: var(--plata);
  font-size: 0.9375rem;
  font-weight: 500;
}
.btn--linea svg { width: 20px; height: 20px; }

/* ------------------------------------------------------------------ pie */
.pie {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 20px;
  padding: 12px max(var(--gutter), env(safe-area-inset-right, 0px)) calc(16px + env(safe-area-inset-bottom, 0px)) max(var(--gutter), env(safe-area-inset-left, 0px));
  border-top: 1px solid var(--linea);
  font-size: 0.8125rem;
  color: var(--niebla);
}
.pie a { display: inline-flex; align-items: center; min-height: 44px; color: var(--niebla); text-underline-offset: 4px; }

/* ------------------------------------------------------------------ hoja del QR */
.hoja-qr {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--plata);
  overscroll-behavior: contain;
}
.hoja-qr[open] { display: grid; place-items: center; }
.hoja-qr::backdrop { background: rgba(5, 5, 6, 0.84); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.hoja-qr__caja {
  position: relative;
  width: min(100% - 32px, 420px);
  padding: 60px 28px 24px;
  border: 1px solid var(--linea);
  border-radius: 20px;
  background: var(--grafito);
  text-align: center;
  transition: opacity 220ms var(--ease-out), transform 220ms var(--ease-out);
}
@starting-style {
  .hoja-qr[open] .hoja-qr__caja { opacity: 0; transform: translateY(10px) scale(0.97); }
}
.hoja-qr__cerrar {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: var(--plata);
  transition: background-color 160ms ease, transform 120ms var(--ease-out);
}
.hoja-qr__cerrar:active { transform: scale(0.94); }
.hoja-qr__cerrar svg { width: 22px; height: 22px; }
.hoja-qr__placa {
  padding: 16px;
  border-radius: 14px;
  background: #f0f0ed;
  box-shadow: inset 0 1px 0 #fff;
}
.hoja-qr__placa svg { display: block; width: 100%; height: auto; aspect-ratio: 1; }
.hoja-qr h2 { margin-top: 22px; font-size: 1.375rem; font-weight: 400; font-stretch: 106%; color: #ececea; }
.hoja-qr p { margin-top: 6px; color: var(--niebla); font-size: 0.9375rem; }
.hoja-qr__descarga {
  margin-top: 10px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 10px;
  color: var(--plata);
  font-size: 0.9375rem;
  text-underline-offset: 4px;
}
.hoja-qr__descarga svg { width: 18px; height: 18px; }

/* ------------------------------------------------------------------ aviso */
.aviso {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  z-index: 10;
  padding: 12px 18px;
  border: 1px solid var(--linea);
  border-radius: 12px;
  background: #1a1a1d;
  color: var(--plata);
  font-size: 0.9375rem;
  opacity: 0;
  transform: translate(-50%, 12px);
  pointer-events: none;
  transition: opacity 200ms ease, transform 200ms var(--ease-out);
}
.aviso.visible { opacity: 1; transform: translate(-50%, 0); }

/* ------------------------------------------------------------------ ratón */
@media (hover: hover) and (pointer: fine) {
  .marca:hover, .idioma button:hover { color: #fff; }
  .btn--plata:hover { background: linear-gradient(180deg, #f6f6f4 0%, #d0d0cb 100%); }
  .btn--linea:hover { background: rgba(255, 255, 255, 0.05); border-color: rgba(255, 255, 255, 0.18); }
  .canales a:hover { background: rgba(255, 255, 255, 0.04); }
  .canales a:hover .flecha { color: var(--plata); transform: translate(2px, -2px); }
  .hoja-qr__cerrar:hover { background: rgba(255, 255, 255, 0.07); }
  .pie a:hover { color: var(--plata); }
}

/* ------------------------------------------------------------------ escritorio */
@media (min-width: 960px) {
  :root { --gutter: 40px; }
  .hoja {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
    align-items: center;
    align-content: center;
    gap: 72px;
    padding-top: 16px;
    padding-bottom: 56px;
  }
  .marco { width: min(100%, 560px); }
}
@media (min-width: 1200px) {
  .marco { width: min(100%, 620px); }
  .ficha { justify-self: start; }
  .pista { font-size: 0.875rem; }
}

/* ------------------------------------------------------------------ movimiento reducido */
@media (prefers-reduced-motion: reduce) {
  .marco { animation: aparece 200ms ease both; }
  .tarjeta__giro { transition: none; }
  .cara__luz::after { display: none; }
  .hoja-qr__caja { transition: opacity 160ms ease; }
  .btn:active, .hoja-qr__cerrar:active { transform: none; }
}
@keyframes aparece { from { opacity: 0; } to { opacity: 1; } }
