/* Dr. Benjamín Rivera: virtual business card (opened from the QR code). Phone-first. */

:root {
  --ink: #0e1b2c;
  --paper: #f6f1e7;
  --teal: #1f6f74;
  --teal-glow: #6fc3bd;
  --copper: #c7784f;
  --copper-deep: #a95d37;
  --on-light: #14202c;
  --muted: #5d6b73;
  --rule: rgba(20, 32, 44, 0.12);
  --font-sans: "Inter Tight", "Helvetica Neue", Arial, sans-serif;
  --font-serif: "Instrument Serif", Georgia, serif;
  --radius: 18px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0; min-height: 100vh;
  background: var(--ink); color: var(--on-light);
  font-family: var(--font-sans); line-height: 1.5; -webkit-font-smoothing: antialiased;
}

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--copper); outline-offset: 3px; }

.card {
  position: relative; max-width: 460px; min-height: 100vh; margin: 0 auto;
  background: var(--paper); overflow: hidden;
  box-shadow: 0 0 80px rgba(0, 0, 0, 0.35);
}

/* Cover */
.card__cover { position: relative; height: 230px; overflow: hidden; background: var(--ink); }
.card__cover img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; }
.card__cover::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(14, 27, 44, 0.15) 0%, rgba(14, 27, 44, 0.85) 100%);
}
.card__orbit { position: absolute; z-index: 1; width: 340px; right: -110px; top: -60px; fill: none; }
.card__ring { stroke: rgba(238, 243, 242, 0.3); stroke-width: 0.4; }
.card__arc {
  stroke: var(--copper); stroke-width: 1; stroke-linecap: round; stroke-dasharray: 14 86;
  transform-origin: 50% 50%; animation: orbit 20s linear infinite;
}
@keyframes orbit { to { transform: rotate(360deg); } }

/* Identity */
.card__identity { position: relative; z-index: 2; padding: 0 24px; text-align: center; margin-top: -68px; }
.card__avatar {
  width: 136px; height: 136px; margin: 0 auto 18px; border-radius: 50%; overflow: hidden;
  display: grid; place-items: center; background: var(--paper);
  border: 4px solid var(--paper); box-shadow: 0 0 0 1px var(--copper), 0 18px 40px -18px rgba(14, 27, 44, 0.6);
}
.card__avatar img { width: 100%; height: 100%; object-fit: cover; }
.card__avatar-mark { width: 62px; height: 92px; color: var(--ink); stroke: var(--copper); }

.card__kicker {
  margin: 0; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--copper-deep);
}
.card__name {
  margin: 6px 0 4px; font-weight: 300; font-size: 2.05rem; line-height: 1.05; letter-spacing: -0.03em;
}
.card__name em { display: block; font-family: var(--font-serif); font-style: italic; font-weight: 400; letter-spacing: -0.01em; color: var(--teal); font-size: 2.4rem; }
.card__role { margin: 0; font-weight: 500; }
.card__school { margin: 6px auto 0; max-width: 300px; font-size: 0.82rem; color: var(--muted); }

.card__save {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  margin: 22px 0 0; padding: 16px 20px; border-radius: 999px;
  background: var(--copper); color: #fff; font-weight: 600; font-size: 1.02rem; text-decoration: none;
  box-shadow: 0 14px 30px -14px rgba(169, 93, 55, 0.9);
  transition: background-color 200ms, transform 200ms var(--ease);
}
.card__save svg { width: 22px; height: 22px; fill: currentColor; }
.card__save:hover { background: var(--copper-deep); }
.card__save:active { transform: scale(0.98); }

/* Action grid */
.card__actions {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px;
  padding: 22px 24px 4px;
}
.card__actions a {
  display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 10px;
  align-items: center; padding: 13px 14px; border-radius: 14px; text-decoration: none;
  background: #fff; box-shadow: 0 1px 0 var(--rule), 0 10px 24px -18px rgba(14, 27, 44, 0.45);
  transition: transform 200ms var(--ease), box-shadow 200ms;
}
.card__actions a:hover { transform: translateY(-2px); box-shadow: 0 1px 0 var(--rule), 0 16px 30px -18px rgba(14, 27, 44, 0.55); }
.card__actions a:active { transform: scale(0.98); }
.card__actions svg {
  grid-row: span 2; width: 38px; height: 38px; padding: 9px; border-radius: 11px;
  fill: var(--teal); background: rgba(31, 111, 116, 0.1);
}
.card__actions .is-whatsapp svg { fill: #1d9e57; background: rgba(37, 211, 102, 0.12); }
.card__actions span { font-weight: 600; font-size: 0.92rem; line-height: 1.2; }
.card__actions small {
  font-size: 0.74rem; color: var(--muted); line-height: 1.25;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* Info */
.card__info { margin: 18px 24px 0; padding: 4px 18px; background: #fff; border-radius: var(--radius); box-shadow: 0 1px 0 var(--rule); }
.info { padding: 14px 0; }
.info + .info { border-top: 1px solid var(--rule); }
.info__label { margin: 0 0 4px; font-size: 0.7rem; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase; color: var(--teal); }
.info__value { margin: 0; font-size: 0.9rem; color: var(--muted); }
.info__value strong { color: var(--on-light); font-weight: 600; }
.info__value a { color: var(--copper-deep); font-weight: 600; text-decoration: none; }

/* Footer */
.card__footer-actions { display: flex; gap: 10px; padding: 18px 24px 0; }
.ghost {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 16px; border-radius: 999px; border: 1px solid rgba(14, 27, 44, 0.25);
  background: transparent; color: var(--ink); font: 500 0.92rem var(--font-sans); text-decoration: none; cursor: pointer;
  transition: background-color 200ms, color 200ms;
}
.ghost[hidden] { display: none; }
.ghost svg { width: 18px; height: 18px; fill: currentColor; }
.ghost:hover { background: var(--ink); color: var(--paper); }

.card__credit {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 26px 24px calc(28px + env(safe-area-inset-bottom)); font-size: 0.78rem; color: var(--muted); letter-spacing: 0.04em;
}
.card__credit-mark { width: 14px; height: 21px; color: var(--ink); stroke: var(--copper); }

/* Entrance */
@media (prefers-reduced-motion: no-preference) {
  .card__identity, .card__actions, .card__info, .card__footer-actions {
    animation: rise 700ms var(--ease) both;
  }
  .card__actions { animation-delay: 90ms; }
  .card__info { animation-delay: 160ms; }
  .card__footer-actions { animation-delay: 220ms; }
  @keyframes rise { from { opacity: 0; transform: translateY(16px); } }
}
@media (prefers-reduced-motion: reduce) {
  .card__arc { animation: none; }
}

@media (max-width: 340px) {
  .card__actions { grid-template-columns: 1fr; }
  .card__name { font-size: 1.8rem; }
  .card__name em { font-size: 2.1rem; }
}

@media (min-width: 461px) {
  body { padding: 32px 0; }
  .card { min-height: auto; border-radius: 28px; }
}
