/* =========================================================
   THE GOAT COMPANY · Link in bio
   Tema claro premium · marfil, blanco y dorado
   ========================================================= */
:root {
  --color-primary: #171717;
  --color-background: #FAF8F3;
  --color-surface: #FFFFFF;
  --color-text: #171717;
  --color-text-secondary: #5C5C5C;
  --color-border: #E7E1D5;
  --color-accent: #D5A64A;
  --color-accent-deep: #8A6420;

  /* Derivados */
  --accent-soft: #FBF1DC;
  --accent-line: rgba(168, 122, 36, 0.42);
  --muted: #6B675C;
  --font: "Montserrat", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --radius: 18px;
  --shadow-card: 0 1px 2px rgba(23, 23, 23, 0.04), 0 12px 26px -14px rgba(23, 23, 23, 0.16);
  --shadow-card-hover: 0 2px 4px rgba(23, 23, 23, 0.04), 0 22px 44px -18px rgba(23, 23, 23, 0.24);
  color-scheme: light;
}

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

html {
  min-height: 100%;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100svh;
  overflow-x: hidden;
  background: var(--color-background);
  color: var(--color-text);
  font-family: var(--font);
  font-weight: 500;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  display: flex;
  justify-content: center;
}

::selection {
  background: rgba(213, 166, 74, 0.35);
  color: var(--color-text);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* =========================================================
   Fondo
   ========================================================= */
.bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(1000px 620px at 50% -14%, #FFF4DE 0%, rgba(255, 244, 222, 0) 64%),
    radial-gradient(760px 520px at 108% 102%, #FBEFD7 0%, rgba(251, 239, 215, 0) 62%),
    linear-gradient(180deg, #FCFAF5 0%, #F8F4EB 46%, #F3EEE2 100%);
}

.bg__grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(23, 23, 23, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23, 23, 23, 0.045) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: radial-gradient(circle at 50% 22%, #000 0%, transparent 70%);
  -webkit-mask-image: radial-gradient(circle at 50% 22%, #000 0%, transparent 70%);
}

.bg__glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  will-change: transform;
}

.bg__glow--1 {
  width: 380px;
  height: 380px;
  top: -160px;
  left: 50%;
  margin-left: -190px;
  background: rgba(213, 166, 74, 0.26);
  animation: drift 16s ease-in-out infinite alternate;
}

.bg__glow--2 {
  width: 300px;
  height: 300px;
  right: -110px;
  bottom: -90px;
  background: rgba(213, 166, 74, 0.16);
  animation: drift 20s -7s ease-in-out infinite alternate-reverse;
}

.bg__mark {
  position: absolute;
  top: 44%;
  left: 50%;
  width: min(112vw, 820px);
  height: auto;
  opacity: 0.035;
  transform: translate(-50%, -50%);
  animation: markFloat 22s ease-in-out infinite alternate;
  user-select: none;
}

.bg__noise {
  position: absolute;
  inset: 0;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.75'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}

/* =========================================================
   Contenedor
   ========================================================= */
.wrap {
  width: 100%;
  max-width: 480px;
  padding:
    calc(26px + env(safe-area-inset-top, 0px))
    20px
    calc(30px + env(safe-area-inset-bottom, 0px));
  position: relative;
}

/* =========================================================
   Barra superior
   ========================================================= */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 34px;
  animation: fadeDown 0.7s var(--ease-out) both;
}

.brandmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #7C7768;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

.brandmark::before {
  content: "";
  width: 28px;
  height: 1px;
  background: linear-gradient(90deg, var(--color-accent), transparent);
}

.share {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 13px;
  border: 1px solid rgba(23, 23, 23, 0.09);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--color-text-secondary);
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(23, 23, 23, 0.04);
  transition:
    color 0.3s,
    background 0.3s,
    border-color 0.3s,
    box-shadow 0.3s,
    transform 0.3s var(--ease-out);
}

.share svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
  transition: transform 0.35s var(--ease-spring);
}

.share:hover,
.share:focus-visible {
  color: var(--color-text);
  background: #fff;
  border-color: var(--accent-line);
  box-shadow: 0 6px 16px -8px rgba(23, 23, 23, 0.25);
  outline: none;
  transform: translateY(-1px);
}

.share:hover svg {
  transform: rotate(-12deg) scale(1.08);
}

.share:active {
  transform: translateY(0) scale(0.98);
}

.share.is-copied {
  color: var(--color-accent-deep);
  border-color: var(--accent-line);
  background: var(--accent-soft);
}

/* =========================================================
   Perfil
   ========================================================= */
.profile {
  text-align: center;
  animation: fadeUp 0.8s 0.08s var(--ease-out) both;
}

.avatar {
  position: relative;
  width: 112px;
  height: 112px;
  margin: 0 auto 20px;
  transform: perspective(700px) rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg));
  transform-style: preserve-3d;
  transition: transform 0.45s var(--ease-out);
  will-change: transform;
}

.avatar__glow {
  position: absolute;
  inset: -24px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(213, 166, 74, 0.3), transparent 68%);
  filter: blur(16px);
  animation: breathe 5s ease-in-out infinite;
}

.avatar__ring {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  background: conic-gradient(
    from 0deg,
    rgba(213, 166, 74, 0) 0deg,
    #E8C47C 60deg,
    #A87A24 120deg,
    #F2DCA8 180deg,
    #C79A45 240deg,
    rgba(213, 166, 74, 0) 300deg,
    rgba(213, 166, 74, 0) 360deg
  );
  animation: spin 8s linear infinite;
}

.avatar__ring::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: var(--color-background);
}

.avatar__img {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  padding: 21px;
  border-radius: 50%;
  object-fit: contain;
  background: radial-gradient(circle at 50% 34%, #FFFFFF 0%, #FDF9F1 58%, #F6EFE1 100%);
  border: 1px solid rgba(168, 122, 36, 0.22);
  box-shadow:
    inset 0 1px 0 #fff,
    0 10px 26px -10px rgba(80, 60, 20, 0.3),
    0 2px 6px rgba(23, 23, 23, 0.05);
}

.avatar__status {
  position: absolute;
  right: 2px;
  bottom: 7px;
  z-index: 2;
  width: 18px;
  height: 18px;
  border: 3px solid var(--color-background);
  border-radius: 50%;
  background: linear-gradient(135deg, #E8C47C, #B8892F);
  box-shadow: 0 0 0 0 rgba(168, 122, 36, 0.5);
  animation: statusPulse 2.2s ease-out infinite;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  padding: 7px 12px;
  border: 1px solid rgba(168, 122, 36, 0.26);
  border-radius: 999px;
  background: linear-gradient(180deg, #FDF4E2, #FAEFD8);
  color: var(--color-accent-deep);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.badge__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-accent-deep);
  box-shadow: 0 0 0 3px rgba(213, 166, 74, 0.22);
  animation: blink 2.2s ease-in-out infinite;
}

h1 {
  margin: 0 0 12px;
  font-size: clamp(30px, 8.4vw, 38px);
  font-weight: 800;
  line-height: 1.06;
  letter-spacing: -0.045em;
  color: var(--color-text);
  text-wrap: balance;
}

h1 .gold {
  display: inline-block;
  background: linear-gradient(
    100deg,
    #8A6420 0%,
    #C79A45 26%,
    #8A6420 48%,
    #D5A64A 68%,
    #8A6420 100%
  );
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shimmer 7s linear infinite;
}

.tag {
  max-width: 360px;
  margin: 0 auto 20px;
  color: var(--color-text-secondary);
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.72;
  text-wrap: pretty;
}

.tag strong {
  color: var(--color-text);
  font-weight: 700;
}

.perks {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 0 0 30px;
  padding: 0;
  list-style: none;
}

.perks li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border: 1px solid rgba(23, 23, 23, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: #454138;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.005em;
  box-shadow: 0 1px 2px rgba(23, 23, 23, 0.03);
}

.perks svg {
  width: 12px;
  height: 12px;
  flex: none;
  fill: var(--color-accent-deep);
}

/* =========================================================
   Enlaces
   ========================================================= */
.links {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.btn {
  --mx: 50%;
  --my: 50%;
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 15px;
  overflow: hidden;
  isolation: isolate;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
  color: var(--color-text);
  text-decoration: none;
  text-align: left;
  box-shadow: var(--shadow-card);
  transition:
    transform 0.38s var(--ease-out),
    border-color 0.38s,
    box-shadow 0.38s,
    background-color 0.38s;
  animation: cardIn 0.7s var(--ease-out) both;
  animation-delay: calc(0.32s + var(--i) * 0.07s);
  -webkit-tap-highlight-color: transparent;
}

.btn > * {
  position: relative;
  z-index: 1;
}

.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background: radial-gradient(
    230px circle at var(--mx) var(--my),
    rgba(213, 166, 74, 0.22),
    transparent 66%
  );
  opacity: 0;
  transition: opacity 0.35s;
}

.btn:hover::before,
.btn:focus-visible::before {
  opacity: 1;
}

.btn:hover,
.btn:focus-visible {
  transform: translateY(-3px);
  border-color: var(--accent-line);
  background-color: #FFFDF8;
  box-shadow: var(--shadow-card-hover);
  outline: none;
}

.btn:focus-visible {
  outline: 2px solid var(--color-accent-deep);
  outline-offset: 3px;
}

.btn:active {
  transform: translateY(-1px) scale(0.995);
}

.btn__icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(23, 23, 23, 0.07);
  border-radius: 12px;
  background: #FBF7EE;
  color: var(--color-accent-deep);
  transition:
    transform 0.38s var(--ease-spring),
    background-color 0.38s,
    border-color 0.38s;
}

.btn__icon svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.btn:hover .btn__icon,
.btn:focus-visible .btn__icon {
  transform: scale(1.07) rotate(-4deg);
  background: #F7EBD2;
  border-color: rgba(168, 122, 36, 0.28);
}

.btn__copy {
  flex: 1;
  min-width: 0;
}

.btn__title {
  display: block;
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.25;
}

.btn__sub {
  display: block;
  margin-top: 3px;
  overflow: hidden;
  color: #6E6A60;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.3;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.btn__arrow {
  display: grid;
  place-items: center;
  flex: none;
  width: 27px;
  height: 27px;
  border: 1px solid rgba(23, 23, 23, 0.1);
  border-radius: 50%;
  color: #8A8578;
  transition:
    transform 0.38s var(--ease-out),
    background-color 0.38s,
    border-color 0.38s,
    color 0.38s;
}

.btn__arrow svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.btn:hover .btn__arrow,
.btn:focus-visible .btn__arrow {
  transform: translateX(3px);
  border-color: var(--color-primary);
  background: var(--color-primary);
  color: #fff;
}

/* --- CTA principal --- */
.btn--primary {
  border-color: transparent;
  background: linear-gradient(120deg, #F0D49A 0%, #D5A64A 46%, #BE8C33 100%);
  color: var(--color-primary);
  box-shadow:
    0 14px 30px -12px rgba(168, 122, 36, 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.45);
  animation: cardIn 0.7s 0.26s var(--ease-out) both;
}

.btn--primary::before {
  background: radial-gradient(
    260px circle at var(--mx) var(--my),
    rgba(255, 255, 255, 0.45),
    transparent 64%
  );
}

.btn--primary::after {
  content: "";
  position: absolute;
  top: -40%;
  bottom: -40%;
  left: -65%;
  z-index: 0;
  width: 42%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.55), transparent);
  transform: skewX(-20deg);
  animation: shine 5.2s 1.4s ease-in-out infinite;
  pointer-events: none;
}

.btn--primary .btn__icon {
  border-color: rgba(23, 23, 23, 0.14);
  background: rgba(23, 23, 23, 0.1);
  color: var(--color-primary);
}

.btn--primary .btn__sub {
  color: rgba(23, 23, 23, 0.72);
}

.btn--primary .btn__arrow {
  border-color: rgba(23, 23, 23, 0.2);
  color: var(--color-primary);
}

.btn--primary:hover,
.btn--primary:focus-visible {
  background: linear-gradient(120deg, #F7DFAF 0%, #E0B45C 46%, #C99A3C 100%);
  border-color: transparent;
  box-shadow:
    0 20px 44px -16px rgba(168, 122, 36, 0.55),
    0 6px 14px -8px rgba(23, 23, 23, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.btn--primary:hover .btn__icon,
.btn--primary:focus-visible .btn__icon {
  background: rgba(23, 23, 23, 0.14);
  border-color: rgba(23, 23, 23, 0.24);
  color: var(--color-primary);
}

.btn--primary:hover .btn__arrow,
.btn--primary:focus-visible .btn__arrow {
  border-color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.9);
  color: var(--color-primary);
}

/* Onda al hacer clic */
.ripple {
  position: absolute;
  z-index: 2;
  border-radius: 50%;
  background: rgba(168, 122, 36, 0.2);
  transform: scale(0);
  pointer-events: none;
  animation: ripple 0.65s ease-out forwards;
}

.btn--primary .ripple {
  background: rgba(23, 23, 23, 0.16);
}

/* =========================================================
   Footer
   ========================================================= */
footer {
  margin-top: 32px;
  text-align: center;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 500;
  line-height: 1.9;
  letter-spacing: 0.02em;
  animation: fadeUp 0.8s 0.85s var(--ease-out) both;
}

footer p {
  margin: 0;
}

.footer__brand {
  color: var(--color-text);
  font-weight: 700;
}

.footer__sep {
  margin: 0 5px;
  color: var(--color-accent-deep);
}

/* =========================================================
   Toast
   ========================================================= */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  z-index: 30;
  padding: 11px 17px;
  border-radius: 999px;
  background: var(--color-primary);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 18px 40px -12px rgba(23, 23, 23, 0.55);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 16px) scale(0.96);
  transition:
    opacity 0.35s var(--ease-out),
    transform 0.35s var(--ease-spring);
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
}

/* =========================================================
   Animaciones
   ========================================================= */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeDown {
  from {
    opacity: 0;
    transform: translateY(-12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes cardIn {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes breathe {
  0%,
  100% {
    opacity: 0.5;
    transform: scale(0.96);
  }
  50% {
    opacity: 1;
    transform: scale(1.06);
  }
}

@keyframes statusPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(168, 122, 36, 0.5);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(168, 122, 36, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(168, 122, 36, 0);
  }
}

@keyframes blink {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.45;
    transform: scale(0.82);
  }
}

@keyframes shimmer {
  to {
    background-position: -220% 0;
  }
}

@keyframes drift {
  from {
    transform: translate3d(-12px, -8px, 0) scale(1);
  }
  to {
    transform: translate3d(18px, 22px, 0) scale(1.12);
  }
}

@keyframes markFloat {
  from {
    transform: translate(-50%, -50%) rotate(-2deg) scale(1);
  }
  to {
    transform: translate(-50%, -52%) rotate(2deg) scale(1.04);
  }
}

@keyframes shine {
  0%,
  62% {
    left: -65%;
  }
  100% {
    left: 135%;
  }
}

@keyframes ripple {
  to {
    transform: scale(1);
    opacity: 0;
  }
}

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 380px) {
  .wrap {
    padding-left: 16px;
    padding-right: 16px;
  }

  .topbar {
    margin-bottom: 28px;
  }

  .avatar {
    width: 100px;
    height: 100px;
  }

  h1 {
    font-size: 29px;
  }

  .tag {
    font-size: 13px;
  }

  .btn {
    gap: 12px;
    padding: 13px;
  }

  .btn__icon {
    width: 39px;
    height: 39px;
  }

  .btn__title {
    font-size: 13px;
  }

  .btn__sub {
    font-size: 10.5px;
  }
}

@media (min-width: 640px) {
  .wrap {
    padding-top: 46px;
    padding-bottom: 42px;
  }

  .topbar {
    margin-bottom: 40px;
  }

  .avatar {
    width: 120px;
    height: 120px;
  }

  .btn {
    padding: 16px 18px;
  }

  .btn__title {
    font-size: 14.5px;
  }

  .btn__sub {
    font-size: 11.5px;
  }
}

/* =========================================================
   Accesibilidad: movimiento reducido
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .avatar {
    transform: none;
  }
}
