:root {
  --bg: #f5f5f5;
  --ink: #111827;
  --muted: #9ca3af;
  --accent: #1db954;
  --of: #00aff0;
  --pad: clamp(1rem, 5vw, 1.5rem);
  --content: 384px;
  --phone: 420px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
}

body.app {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  font-family: "Outfit", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.4;
  overflow-x: hidden;
  position: relative;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
}

.backdrop {
  display: none;
}

.page {
  position: relative;
  z-index: 1;
  width: 100%;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  padding-bottom: max(1.5rem, env(safe-area-inset-bottom));
}

/* Hero — mismo patrón que linklylo: 21/19, max 60dvh */
.hero {
  position: relative;
  width: 100%;
  aspect-ratio: 21 / 19;
  max-height: 60dvh;
  min-height: 0;
  flex-shrink: 0;
  overflow: hidden;
}

.hero__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 58%;
}

.hero__fade {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 55%, var(--bg) 100%);
  pointer-events: none;
}

/* Profile */
.profile {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: var(--content);
  margin: -2rem auto 0;
  padding: 0 var(--pad) 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.1rem;
  text-align: center;
  flex: 1;
}

.profile__heading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
}

.profile__name {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  font-size: clamp(1.35rem, 5.5vw, 1.5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--ink);
}

.verified {
  display: inline-flex;
  flex-shrink: 0;
}

.profile__role {
  font-size: clamp(0.65rem, 2.8vw, 0.72rem);
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--ink);
}

.profile__role .amp {
  color: #9a9a9a;
  margin: 0 0.15em;
}

.social {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  transition: transform 0.25s var(--ease), opacity 0.2s ease;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
  background: #fff;
}

.social:hover {
  transform: scale(1.06);
  opacity: 0.9;
}

.social:active {
  transform: scale(0.96);
}

.social:focus-visible {
  outline: 2px solid #d6249f;
  outline-offset: 3px;
}

body.modal-open {
  overflow: hidden;
}

.cta-stack {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.75rem;
  width: 100%;
  margin-top: 0.15rem;
}

.cta-btn {
  width: 100%;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  border: 2px solid var(--of);
  border-radius: 12px;
  padding: 0.75rem 1rem;
  font-size: clamp(0.88rem, 3.6vw, 0.95rem);
  font-weight: 700;
  letter-spacing: 0.01em;
  color: #111;
  background: #fff;
  cursor: pointer;
  transition: transform 0.2s var(--ease), background 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 4px 14px rgba(0, 175, 240, 0.18);
}

.cta-btn__lock {
  color: var(--of);
  flex-shrink: 0;
}

.cta-btn:hover {
  background: #f7fcff;
  transform: translateY(-1px);
}

.cta-btn:active {
  transform: translateY(0);
}

.cta-btn:focus-visible {
  outline: 2px solid var(--of);
  outline-offset: 3px;
}

/* CTA Fanvue — formato horizontal tipo linklylo */
.cta {
  position: relative;
  display: block;
  width: 100%;
  border: none;
  padding: 0;
  background: transparent;
  cursor: pointer;
  text-align: left;
  border-radius: 16px;
  overflow: hidden;
  isolation: isolate;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
}

.cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.14);
}

.cta:active {
  transform: translateY(0);
}

.cta:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

.cta__img {
    display: block;
    width: 100%;
    height: 332px;
    max-height: 172px;
    object-fit: cover;
    object-position: center 48%;
    transition: transform 0.5s var(--ease);
}

.cta:hover .cta__img {
  transform: scale(1.03);
}

.cta::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.45) 0%,
    rgba(0, 0, 0, 0.1) 35%,
    transparent 60%
  );
  pointer-events: none;
  z-index: 1;
}

.cta__label {
  position: absolute;
  left: 0.85rem;
  bottom: 0.75rem;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: #fff;
  font-size: 0.95rem;
  font-weight: 600;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.4);
  pointer-events: none;
}

.cta__dot {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  background: var(--accent);
  flex-shrink: 0;
}

/* Footer */
.footer {
  width: 100%;
  max-width: var(--phone);
  margin: 1.25rem auto 0;
  padding: 1rem var(--pad) max(1.25rem, env(safe-area-inset-bottom));
  text-align: center;
  font-size: 0.7rem;
  color: var(--muted);
  opacity: 0.85;
}

.footer__links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
  margin-bottom: 0.5rem;
}

.footer__links a {
  color: inherit;
  transition: opacity 0.2s ease;
}

.footer__links a:hover {
  opacity: 0.7;
}

.footer__copy {
  font-size: 0.65rem;
  opacity: 0.8;
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: max(1rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right))
    max(1rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
}

.modal[hidden] {
  display: none;
}

.modal__scrim {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  cursor: pointer;
  animation: fadeIn 0.25s var(--ease) both;
}

.modal__content {
  position: relative;
  z-index: 1;
  width: min(100%, 320px);
  text-align: center;
  pointer-events: none;
  animation: rise 0.3s var(--ease) both;
}

.modal__content .btn {
  pointer-events: auto;
}

.modal__title {
  font-size: clamp(1.35rem, 5vw, 1.55rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: #111;
  margin-bottom: 0.7rem;
}

.modal__text {
  font-size: clamp(0.88rem, 3.5vw, 0.95rem);
  color: #111;
  line-height: 1.4;
  margin-bottom: 1.5rem;
}

.modal__tip {
  font-size: 0.78rem;
  color: #555;
  line-height: 1.35;
  margin: -0.75rem 0 1.15rem;
}

.modal__content--escape {
  width: min(100%, 340px);
  pointer-events: auto;
}

.escape-steps {
  text-align: left;
  margin: 0 0 1.25rem;
  padding-left: 1.2rem;
  font-size: 0.9rem;
  line-height: 1.45;
  color: #222;
}

.escape-steps li + li {
  margin-top: 0.55rem;
}

.modal__actions--stack {
  grid-template-columns: 1fr;
}

.btn--light {
  background: #fff;
  color: #111;
  border: 1.5px solid #111;
}

.btn--light:hover {
  background: #f5f5f5;
}

.btn--ghost {
  background: transparent;
  color: #444;
  box-shadow: none;
}

.btn--ghost:hover {
  background: rgba(0, 0, 0, 0.06);
}

.modal__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0.7rem 0.9rem;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  background: #1a1a1a;
  color: #fff;
  transition: transform 0.2s var(--ease), background 0.2s ease;
}

.btn:hover {
  background: #2e2e2e;
}

.btn:active {
  transform: scale(0.97);
}

.btn:focus-visible {
  outline: 2px solid #1a1a1a;
  outline-offset: 2px;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Desktop ≥820px — tarjeta tipo teléfono (linklylo) */
@media (min-width: 820px) {
  body.app {
    background: #0a0a0a;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
  }

  .backdrop {
    display: block;
    position: fixed;
    inset: -60px;
    z-index: 0;
    background-size: cover;
    background-position: center;
    filter: blur(90px) saturate(1.4);
    transform: scale(1.15);
  }

  .backdrop::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, transparent 0%, rgba(0, 0, 0, 0.6) 100%);
  }

  .page {
    width: var(--phone);
    min-height: auto;
    margin: 0 auto;
    border-radius: 32px;
    overflow: hidden;
    box-shadow:
      0 40px 100px rgba(0, 0, 0, 0.65),
      0 0 0 1px rgba(255, 255, 255, 0.08);
    flex: 0 0 auto;
  }

  .hero {
    aspect-ratio: auto;
    height: 380px;
    max-height: none;
  }

  .profile {
    margin-top: -2rem;
  }

  .cta__img {
    height: 140px;
    max-height: 140px;
  }
}

/* Pantallas bajas */
@media (max-height: 700px) {
  .hero {
    max-height: 42dvh;
  }

  .profile {
    gap: 0.85rem;
    margin-top: -1.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
