/* Tarjeta digital · José Rodríguez
   Negro y plateado. Mobile primero. */

:root {
  --bg: #0B0C0E;
  --ink: #E8EBF0;
  --silver: #C9CED6;
  --muted: #9AA1AB;
  --line: #2A2E35;
  --btn: #D9DDE4;
  --wa: #25D366;
  --display: 'Archivo', system-ui, sans-serif;
  --body: 'Instrument Sans', system-ui, sans-serif;
  /* Letra del saludo "Gracias": cambiala acá si querés otra */
  --script: 'Cormorant Garamond', Georgia, serif;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--silver);
  font-family: var(--body);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}
button, a { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
button { -webkit-appearance: none; appearance: none; font: inherit; }

/* ---------- Banner con la foto del auto ---------- */
.banner { position: relative; height: 240px; overflow: hidden; }
.banner__img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover; object-position: 50% 45%;
}
.banner__fade {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(11, 12, 14, 0) 40%, var(--bg) 100%);
}
.banner__inner { position: relative; height: 100%; max-width: 440px; margin: 0 auto; }

.thanks {
  position: absolute; left: 20px; bottom: 50px;
  margin: 0; padding: 6px 4px; border: 0; cursor: pointer;
  font-family: var(--script); font-style: italic; font-weight: 500;
  font-size: 25px; line-height: 1.25;
  color: var(--silver);
  background: linear-gradient(105deg, #AEB4BD 0%, #AEB4BD 35%, #FFFFFF 50%, #AEB4BD 65%, #AEB4BD 100%);
  background-size: 300% 100%;
  background-position: 100% 0;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 -1px 0 rgba(255, 255, 255, 0.2)) drop-shadow(0 2px 3px rgba(0, 0, 0, 0.85));
  transition: background-position 1.1s ease, transform 0.15s ease;
  transform-origin: left center;
}
.thanks.is-swept { background-position: 0% 0; }
.thanks.is-pressed { transform: scale(0.96); }

/* ---------- Contenido ---------- */
.page {
  position: relative; z-index: 1;
  width: 100%; max-width: 440px;
  margin: -32px auto 0;
  padding: 0 20px max(28px, env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 20px;
}

/* Tarjeta */
.avatar {
  display: block; width: 64px; height: 64px; margin: 0 auto 4px;
  border-radius: 50%; object-fit: cover; border: 2px solid #3A3F47;
  box-shadow: 0 0 0 4px #0B0C0E, 0 10px 30px rgba(0, 0, 0, .6), inset 0 1px 0 rgba(255, 255, 255, .1);
}

.card {
  display: flex; flex-direction: column; gap: 40px;
  padding: 22px 22px 26px;
  border: 1px solid #2B2F36; border-radius: 10px;
  background: radial-gradient(130% 90% at 0% 0%, #22262C 0%, #15171B 55%, #101215 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07), 0 28px 48px -28px rgba(0, 0, 0, 0.9);
}
.card__top { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.card__id {
  margin: 0; font-size: 11px; line-height: 1.8;
  letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted);
}
.card__id span { display: block; }
.card__name { color: var(--ink); }
.card__mark {
  font-family: var(--display); font-stretch: 125%; font-weight: 800;
  font-size: 40px; line-height: 0.9; letter-spacing: -0.02em;
  color: #1A1D21;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.09), 0 -1px 0 rgba(0, 0, 0, 0.85);
}
.card__alias { display: flex; flex-direction: column; gap: 10px; }
.label { font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); }

/* El alias se achica solo para entrar siempre en una línea */
.alias-wrap { container-type: inline-size; width: 100%; }
.alias {
  --fit: 16.8;
  display: inline-block; max-width: none;
  font-size: 17px; /* base segura; el JS lo ajusta exacto */
  font-family: var(--display); font-stretch: 112%; font-weight: 800;
  line-height: 1.15; letter-spacing: -0.01em;
  text-transform: uppercase; white-space: nowrap;
  -webkit-user-select: all; user-select: all;
  color: #E3E6EB;
  background: linear-gradient(180deg, #F6F8FA 0%, #B4BAC3 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}

@supports (width: 1cqw) {
  .alias { font-size: min(34px, calc(100cqw / var(--fit))); }
}

/* Botón principal */
.copy {
  width: 100%; min-height: 60px;
  border: 0; border-radius: 10px;
  background: var(--btn); color: var(--bg);
  font-family: var(--body); font-size: 18px; font-weight: 600;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.12s ease, background-color 0.12s ease;
}
.copy:active { transform: scale(0.98); background: #C6CBD3; }
.wa:active { transform: scale(0.94); }
.copy .state { display: inline-flex; align-items: center; gap: 10px; }
.copy:focus-visible, .wa:focus-visible, .thanks:focus-visible { outline: 2px solid #FFFFFF; outline-offset: 3px; }
.copy-error { margin: 0; text-align: center; font-size: 14px; line-height: 1.5; color: var(--muted); }

/* Viaje particular */
.more {
  margin-top: 16px; padding-top: 20px;
  border-top: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.more p { margin: 0; font-size: 15px; line-height: 1.4; color: var(--silver); }
.wa {
  width: 48px; height: 48px; flex-shrink: 0;
  border-radius: 50%; background: var(--wa); color: var(--bg);
  display: flex; align-items: center; justify-content: center;
}

@media (prefers-reduced-motion: reduce) {
  .thanks { transition: none; }
}

@media (max-width: 360px) {
  .page { padding-left: 14px; padding-right: 14px; gap: 16px; }
  .card { padding: 18px 16px 22px; gap: 32px; }
  .card__mark { font-size: 34px; }
  .card__id { letter-spacing: 0.14em; font-size: 10.5px; }
  .more p { font-size: 14px; }
  .thanks { left: 14px; font-size: 24px; }
}
@media (max-height: 640px) and (max-width: 500px) {
  .banner { height: 200px; }
  .thanks { bottom: 42px; }
}

@media (min-width: 600px) {
  .banner { height: 300px; }
  .thanks { bottom: 70px; }
  .page { margin-top: -40px; }
}
