:root {
  --pink: #f51c75;
  --pink-dark: #cc0d58;
  --ink: #8a3157;
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: "DM Sans", sans-serif;
  background:
    radial-gradient(circle at 50% 18%, rgba(255,255,255,.96) 0 12%, transparent 38%),
    linear-gradient(145deg, #fff3f7 0%, #ffdbe8 48%, #ffeef4 100%);
  overflow-x: hidden;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .19;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.22'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
}

.hearts { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }
.heart {
  position: absolute;
  color: #ff8fb4;
  opacity: .22;
  filter: blur(4px);
  text-shadow: 0 10px 28px rgba(245,28,117,.28);
  animation: drift 6s ease-in-out infinite alternate;
}
.h1 { left: 6%; top: 15%; font-size: 5rem; transform: rotate(-20deg); }
.h2 { right: 8%; top: 9%; font-size: 8rem; animation-delay: -2s; }
.h3 { left: 15%; bottom: 10%; font-size: 7rem; animation-delay: -4s; }
.h4 { right: 17%; bottom: 12%; font-size: 4rem; animation-delay: -1s; }
.h5 { left: 2%; top: 52%; font-size: 3rem; animation-delay: -3s; }
.h6 { right: 3%; top: 54%; font-size: 6rem; animation-delay: -5s; }
.h7 { left: 28%; top: 5%; font-size: 2.4rem; }
.h8 { right: 27%; bottom: 4%; font-size: 3rem; animation-delay: -3s; }

.link-page {
  position: relative;
  z-index: 1;
  width: min(760px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 44px 0 54px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.profile { text-align: center; }
.avatar-wrap {
  position: relative;
  width: 188px;
  height: 188px;
  margin: 0 auto 12px;
  padding: 5px;
  border-radius: 50%;
  background: linear-gradient(145deg, #ff7fab, var(--pink));
  box-shadow: 0 14px 38px rgba(226,29,102,.2), 0 0 0 7px rgba(255,255,255,.55);
}
.avatar-wrap img {
  width: 100%; height: 100%;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 20%;
  border: 4px solid white;
}
.mini-heart {
  position: absolute;
  right: -26px; top: 2px;
  color: var(--pink);
  font-size: 3.5rem;
  transform: rotate(13deg);
  text-shadow: 0 3px 0 white, 0 7px 16px rgba(226,29,102,.25);
  animation: heartbeat 1.8s ease-in-out infinite;
}
h1 {
  margin: 6px 0 20px;
  color: var(--pink);
  font-family: "Fredoka", sans-serif;
  font-size: clamp(2.4rem, 5.4vw, 3.96rem);
  line-height: .95;
  letter-spacing: -.07em;
  -webkit-text-stroke: 7px white;
  paint-order: stroke fill;
  text-shadow: 0 4px 0 #ff79a7, 0 8px 0 var(--pink-dark), 0 13px 18px rgba(173,10,72,.2);
}
.profile-title {
  width: min(80%, 480px);
  margin: 4px auto 8px;
  line-height: 0;
  letter-spacing: 0;
  -webkit-text-stroke: 0;
  text-shadow: none;
}
.profile-title img {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 10px 14px rgba(173,10,72,.14));
}

.ticker {
  width: 100%;
  margin: 16px 0 20px;
  overflow: hidden;
  border: 2px solid rgba(245,28,117,.28);
  border-radius: 999px;
  background: rgba(255,255,255,.66);
  box-shadow: 0 9px 26px rgba(198,28,91,.11);
}
.ticker-track {
  width: max-content;
  display: flex;
  animation: ticker-slide 18s linear infinite;
}
.ticker-set {
  display: flex;
  align-items: center;
  padding: 10px 0;
}
.ticker span {
  display: flex;
  align-items: center;
  white-space: nowrap;
  color: var(--pink);
  font-family: "Fredoka", sans-serif;
  font-size: .86rem;
  letter-spacing: .035em;
  text-transform: none;
}
.ticker span::after {
  content: "♥";
  margin: 0 1.25rem;
  color: #ff79a7;
  font-size: .62rem;
}
.ticker:hover .ticker-track { animation-play-state: paused; }

.social-links {
  display: flex;
  justify-content: center;
  gap: 28px;
  margin: 0 0 24px;
}
.social-link {
  width: 74px;
  display: grid;
  justify-items: center;
  gap: 9px;
  color: var(--pink);
  font-family: "Fredoka", sans-serif;
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .01em;
  text-decoration: none;
}
.icon-bubble {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border: 3px solid rgba(245,28,117,.25);
  border-radius: 50%;
  color: var(--pink);
  background: rgba(255,255,255,.94);
  box-shadow: 0 6px 0 #ff8bb3, 0 12px 24px rgba(198,28,91,.16);
  transition: transform .2s ease, box-shadow .2s ease, color .2s ease;
}
.icon-bubble svg { width: 27px; height: 27px; }
.social-link:hover .icon-bubble,
.social-link:focus-visible .icon-bubble {
  color: var(--pink-dark);
  transform: translateY(-4px) rotate(-3deg);
  box-shadow: 0 9px 0 #ff8bb3, 0 17px 30px rgba(198,28,91,.22);
}
.social-link:focus-visible { outline: 3px solid rgba(245,28,117,.28); outline-offset: 5px; border-radius: 14px; }

.links { display: grid; gap: 0; }
.link-banner {
  position: relative;
  isolation: isolate;
  min-height: 190px;
  overflow: hidden;
  display: block;
  border: 5px solid rgba(255,255,255,.92);
  border-radius: 38px;
  box-shadow: 0 13px 35px rgba(198,28,91,.18), inset 0 0 0 2px rgba(255,95,151,.36);
  text-decoration: none;
  transform: translateZ(0);
  transition: transform .25s ease, box-shadow .25s ease;
}
.link-banner img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: transform .35s ease, filter .35s ease;
}
.link-banner::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0;
  background: rgba(255,255,255,.12);
  transition: opacity .25s ease;
}
.link-banner:hover { transform: translateY(-5px) scale(1.008); box-shadow: 0 20px 46px rgba(198,28,91,.27), inset 0 0 0 2px rgba(255,95,151,.45); }
.link-banner:hover::after { opacity: 1; }
.link-banner:hover img { transform: scale(1.035); filter: saturate(1.06); }
.instagram,
.beacons,
.mini-game {
  min-height: 0;
  aspect-ratio: 3 / 1;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.instagram::after,
.beacons::after,
.mini-game::after { display: none; }
.instagram:hover,
.beacons:hover,
.mini-game:hover { box-shadow: none; }
.instagram img,
.beacons img,
.mini-game img { object-fit: contain; object-position: center; }

@keyframes drift { to { transform: translate3d(10px,-18px,0) rotate(7deg); } }
@keyframes heartbeat { 50% { transform: rotate(13deg) scale(1.12); } }
@keyframes ticker-slide { to { transform: translateX(-50%); } }

@media (max-width: 620px) {
  .link-page { width: min(100% - 22px, 520px); padding: 28px 0 34px; justify-content: flex-start; }
  .avatar-wrap { width: 144px; height: 144px; }
  .mini-heart { right: -20px; font-size: 2.7rem; }
  h1 { margin-bottom: 16px; font-size: clamp(2.22rem, 12vw, 3.24rem); -webkit-text-stroke-width: 4px; }
  .profile-title { width: 80%; margin: 2px auto 4px; -webkit-text-stroke: 0; }
  .ticker { margin: 16px 0 14px; }
  .ticker-set { padding: 8px 0; }
  .ticker span { font-size: .78rem; }
  .social-links { gap: 18px; margin-bottom: 20px; }
  .social-link { width: 66px; gap: 8px; font-size: .72rem; }
  .icon-bubble { width: 52px; height: 52px; border-width: 2px; box-shadow: 0 5px 0 #ff8bb3, 0 10px 20px rgba(198,28,91,.15); }
  .icon-bubble svg { width: 24px; height: 24px; }
  .links { gap: 0; }
  .link-banner { min-height: 160px; border-width: 4px; border-radius: 29px; }
  .instagram,
  .beacons,
  .mini-game { min-height: 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Instagram-style profile stories */
.avatar-wrap.story-trigger {
  display: block;
  border: 0;
  color: inherit;
  font: inherit;
  cursor: pointer;
  isolation: isolate;
}
.avatar-wrap.story-trigger::after {
  content: "";
  position: absolute;
  inset: -7px;
  z-index: -1;
  border: 2px solid rgba(245,28,117,.35);
  border-radius: 50%;
  animation: story-ring 2.2s ease-in-out infinite;
}
.story-hint {
  position: absolute;
  left: 50%;
  bottom: -17px;
  padding: 4px 9px;
  border-radius: 999px;
  color: white;
  background: var(--pink);
  font: 700 .58rem/1 "DM Sans", sans-serif;
  white-space: nowrap;
  transform: translateX(-50%);
  box-shadow: 0 4px 12px rgba(173,10,72,.2);
}
.story-dialog {
  inset: 0;
  width: 100vw;
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  overflow: hidden;
  background: rgba(22,5,13,.94);
  opacity: 0;
  transition: opacity .28s ease;
}
.story-dialog[open] { display: grid; place-items: center; }
.story-dialog::backdrop { background: rgba(22,5,13,.72); backdrop-filter: blur(10px); }
.story-dialog.is-open { opacity: 1; }
.story-viewer {
  position: relative;
  width: min(100vw, 450px, 56.25dvh);
  aspect-ratio: 9 / 16;
  overflow: hidden;
  border-radius: 24px;
  background: #14040a;
  box-shadow: 0 30px 90px rgba(0,0,0,.55);
  transform: translateY(16px) scale(.96);
  transition: transform .36s cubic-bezier(.22,.9,.28,1);
}
.story-dialog.is-open .story-viewer { transform: translateY(0) scale(1); }
.story-progress {
  position: absolute;
  z-index: 8;
  top: 12px;
  left: 12px;
  right: 12px;
  display: flex;
  gap: 4px;
}
.story-progress span { height: 3px; flex: 1; overflow: hidden; border-radius: 3px; background: rgba(255,255,255,.34); }
.story-progress i { display: block; width: 100%; height: 100%; background: white; transform: scaleX(0); transform-origin: left; }
.story-header {
  position: absolute;
  z-index: 8;
  top: 28px;
  left: 14px;
  right: 12px;
  display: grid;
  grid-template-columns: 35px 1fr 34px 34px;
  gap: 9px;
  align-items: center;
  color: white;
  text-shadow: 0 1px 7px rgba(0,0,0,.65);
}
.story-header > img { width: 35px; height: 35px; border: 2px solid white; border-radius: 50%; object-fit: cover; }
.story-header > div { display: grid; gap: 1px; }
.story-header strong { font: 700 .82rem/1.1 "DM Sans", sans-serif; }
.story-header span { color: rgba(255,255,255,.74); font: 600 .64rem/1.1 "DM Sans", sans-serif; }
.story-close,
.story-sound { width: 34px; height: 34px; padding: 0; border: 0; border-radius: 50%; color: white; background: rgba(0,0,0,.24); backdrop-filter: blur(7px); font-size: 1.45rem; line-height: 1; }
.story-sound { font-size: 1rem; }
.story-stage { position: absolute; inset: 0; background: #1a080f; }
.story-stage.is-changing .story-media { animation: story-media-in .32s ease both; }
.story-media { position: absolute; inset: 0; width: 100%; height: 100%; display: none; object-fit: cover; }
.story-media.is-active { display: block; }
.story-stage::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg,rgba(0,0,0,.38),transparent 22%,transparent 67%,rgba(0,0,0,.48)); }
.story-loading { position: absolute; z-index: 2; inset: 0; display: grid; place-items: center; color: white; font: 700 .75rem "DM Sans", sans-serif; }
.story-loading.is-hidden { display: none; }
.story-zone { position: absolute; z-index: 5; top: 75px; bottom: 90px; width: 43%; border: 0; background: transparent; }
.story-previous { left: 0; }
.story-next { right: 0; }
.story-footer { position: absolute; z-index: 8; left: 18px; right: 18px; bottom: 18px; }
.story-cta { min-height: 52px; padding: 0 20px; border: 1px solid rgba(255,255,255,.5); border-radius: 999px; display: flex; align-items: center; justify-content: center; gap: 12px; color: var(--pink); background: rgba(255,255,255,.94); font: 800 .9rem/1 "DM Sans", sans-serif; text-decoration: none; box-shadow: 0 10px 30px rgba(0,0,0,.22); backdrop-filter: blur(12px); transition: transform .2s ease, background .2s ease; }
.story-cta:hover { transform: translateY(-2px); background: white; }
.story-cta span { font-size: 1.25rem; }
body.story-open { overflow: hidden; }
@keyframes story-ring { 50% { transform: scale(1.045); opacity: .45; } }
@keyframes story-media-in { from { opacity: .55; transform: scale(1.035); } }
@media (max-width: 500px) {
  .story-viewer { width: min(100vw, 56.25dvh); border-radius: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  .avatar-wrap.story-trigger::after { animation: none; }
  .story-dialog,
  .story-viewer { transition: none; }
  .story-stage.is-changing .story-media { animation: none; }
}
