/* --------------------------------------------------------------------------
   Design tokens e reset
   -------------------------------------------------------------------------- */

:root {
  color-scheme: dark;
  --primary: #7b35f2;
  --secondary: #ff8a34;
  --page-background: #140a24;
  --glass-opacity: 0.18;
  --glass-opacity-percent: 18%;
  --glass-blur: 20px;
  --glass-color: #ffffff;
  --card-gap: 13px;
  --content-width: 680px;
  --background-speed-factor: 1;
  --text-main: #fffaf6;
  --text-muted: rgba(255, 250, 246, 0.62);
  --text-soft: rgba(255, 250, 246, 0.4);
  --line: rgba(255, 255, 255, 0.12);
  --panel: rgba(31, 19, 46, 0.62);
  --danger: #ff6675;
  --success: #62e6a8;
  --font-body: Inter, Aptos, "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-display: "Segoe UI Variable Display", Inter, Aptos, var(--font-body);
}

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

html {
  min-height: 100%;
  background: var(--page-background);
}

body {
  min-width: 320px;
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  color: var(--text-main);
  background: var(--page-background);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
  color: inherit;
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
  text-decoration: none;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--secondary) 72%, white);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

/* --------------------------------------------------------------------------
   Sfondo animato
   -------------------------------------------------------------------------- */

.animated-background,
.preview-screen {
  position: fixed;
  z-index: 0;
  inset: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% -20%, rgba(255, 255, 255, 0.08), transparent 35%),
    var(--page-background);
  background-size: 140% 140%, auto;
  animation: background-breathe calc(7s * var(--background-speed-factor)) ease-in-out infinite alternate;
}

.background-photo {
  position: absolute;
  z-index: -3;
  inset: -4%;
  background-position: center;
  background-size: cover;
  opacity: 0;
  filter: saturate(0.9) brightness(0.42);
  transform: scale(1.08);
  transition: opacity 500ms ease;
}

.background-photo.is-visible {
  opacity: 0.58;
  animation: photo-drift calc(16s * var(--background-speed-factor)) ease-in-out infinite alternate;
}

.background-grid {
  position: absolute;
  z-index: -1;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-position: center;
  background-size: 54px 54px;
  mask-image: radial-gradient(circle at center, black 8%, transparent 72%);
  animation: grid-drift 18s linear infinite;
}

.color-orb {
  position: absolute;
  z-index: -2;
  width: min(700px, 74vw);
  aspect-ratio: 1;
  border-radius: 50%;
  opacity: 0.38;
  filter: blur(100px);
  will-change: transform;
}

.animated-background .background-photo {
  z-index: 0;
}

.animated-background .color-orb {
  z-index: 1;
}

.animated-background .background-grid {
  z-index: 2;
}

.color-orb--purple {
  top: -28%;
  left: -20%;
  background: var(--primary);
  animation: orb-purple 16s ease-in-out infinite alternate;
}

.color-orb--orange {
  right: -25%;
  bottom: -32%;
  background: var(--secondary);
  animation: orb-orange 19s ease-in-out infinite alternate;
}

.color-orb--pink {
  top: 36%;
  left: 50%;
  width: min(480px, 55vw);
  background: #d42f9b;
  opacity: 0.18;
  animation: orb-pink 14s ease-in-out infinite alternate;
}

/* --------------------------------------------------------------------------
   Elementi riutilizzabili
   -------------------------------------------------------------------------- */

.glass-panel {
  border: 1px solid var(--line);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.025)),
    color-mix(in srgb, var(--glass-color) var(--glass-opacity-percent), rgba(18, 10, 29, 0.52));
  box-shadow:
    0 24px 70px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(var(--glass-blur)) saturate(1.25);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.25);
}

.primary-button,
.secondary-button,
.round-button,
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  cursor: pointer;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background 180ms ease,
    opacity 180ms ease;
}

.primary-button {
  min-height: 44px;
  gap: 8px;
  padding: 0 18px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 13px;
  color: white;
  background: linear-gradient(135deg, var(--primary), #9a4df5 58%, var(--secondary));
  box-shadow:
    0 12px 30px color-mix(in srgb, var(--primary) 28%, transparent),
    inset 0 1px rgba(255, 255, 255, 0.22);
  font-size: 0.78rem;
  font-weight: 800;
}

.secondary-button {
  min-height: 42px;
  gap: 8px;
  padding: 0 15px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  color: rgba(255, 255, 255, 0.72);
  background: rgba(255, 255, 255, 0.055);
  font-size: 0.74rem;
  font-weight: 750;
}

.round-button,
.icon-button {
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.78);
  background: rgba(255, 255, 255, 0.06);
}

.round-button {
  width: 40px;
  height: 40px;
  border-radius: 50%;
}

.icon-button {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  font-size: 1rem;
}

.icon-button--danger {
  color: #ff9aa4;
}

.primary-button:hover,
.secondary-button:hover,
.round-button:hover,
.icon-button:hover:not(:disabled) {
  transform: translateY(-2px);
}

.secondary-button:hover,
.round-button:hover,
.icon-button:hover:not(:disabled) {
  border-color: rgba(255, 255, 255, 0.2);
  color: white;
  background: rgba(255, 255, 255, 0.1);
}

button:disabled,
.is-busy {
  cursor: wait;
  opacity: 0.58;
}

.section-kicker,
.profile-label {
  color: color-mix(in srgb, var(--secondary) 72%, white);
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.spinner {
  display: block;
  width: 34px;
  height: 34px;
  border: 3px solid rgba(255, 255, 255, 0.12);
  border-top-color: var(--secondary);
  border-radius: 50%;
  animation: spin 800ms linear infinite;
}

.toast {
  position: fixed;
  z-index: 100;
  right: 22px;
  bottom: 22px;
  max-width: min(360px, calc(100vw - 32px));
  padding: 12px 16px;
  border: 1px solid rgba(98, 230, 168, 0.3);
  border-radius: 13px;
  color: #d8ffed;
  background: rgba(20, 42, 33, 0.92);
  box-shadow: 0 18px 55px rgba(0, 0, 0, 0.36);
  backdrop-filter: blur(18px);
  font-size: 0.76rem;
  font-weight: 800;
  animation: toast-in 240ms ease-out;
}

.toast--error {
  border-color: rgba(255, 102, 117, 0.35);
  color: #ffdadd;
  background: rgba(57, 18, 27, 0.94);
}

/* --------------------------------------------------------------------------
   Profilo e card condivisi tra pagina pubblica e anteprima admin
   -------------------------------------------------------------------------- */

.profile-layout {
  position: relative;
  z-index: 1;
  width: min(100%, 680px);
  margin: 0 auto;
}

.profile-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.avatar-frame {
  position: relative;
  display: grid;
  width: 116px;
  height: 116px;
  margin-bottom: 24px;
  padding: 5px;
  place-items: center;
  border-radius: 34px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  box-shadow:
    0 24px 70px color-mix(in srgb, var(--primary) 24%, transparent),
    0 8px 24px rgba(0, 0, 0, 0.36);
  transform: rotate(-2deg);
}

.avatar-frame::before {
  position: absolute;
  inset: 1px;
  content: "";
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 33px;
}

.avatar-frame img {
  width: 100%;
  height: 100%;
  border-radius: 29px;
  object-fit: cover;
}

.status-dot {
  position: absolute;
  right: -2px;
  bottom: 8px;
  width: 22px;
  height: 22px;
  border: 5px solid var(--page-background);
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 18px rgba(98, 230, 168, 0.7);
}

.profile-header h1 {
  margin: 8px 0 0;
  font-family: var(--font-display);
  font-size: clamp(2.3rem, 9vw, 3.8rem);
  line-height: 0.98;
  letter-spacing: -0.055em;
  text-wrap: balance;
}

.profile-handle {
  margin: 11px 0 0;
  color: color-mix(in srgb, var(--primary) 55%, white);
  font-size: 0.9rem;
  font-weight: 750;
}

.profile-bio {
  max-width: 530px;
  margin: 16px auto 0;
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.7;
  text-wrap: balance;
}

.profile-items {
  display: grid;
  gap: 13px;
  margin-top: 38px;
}

.profile-card {
  --pointer-x: 50%;
  --pointer-y: 50%;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border-radius: 24px;
  animation: card-reveal 550ms both;
  animation-delay: calc(var(--item-order, 0) * 65ms);
}

.profile-card::before {
  position: absolute;
  z-index: -1;
  inset: 0;
  content: "";
  background: radial-gradient(
    260px circle at var(--pointer-x) var(--pointer-y),
    rgba(255, 255, 255, 0.18),
    transparent 54%
  );
  opacity: 0;
  transition: opacity 220ms ease;
}

.profile-card:hover::before {
  opacity: 1;
}

.profile-card--glass,
.profile-card--solid,
.profile-card--outline {
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow:
    0 18px 50px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.profile-card--glass {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.13), transparent 62%),
    rgba(255, 255, 255, var(--glass-opacity));
  backdrop-filter: blur(var(--glass-blur)) saturate(1.3);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.3);
}

.profile-card--solid {
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 26%, #24162f), #1b1125 72%);
}

.profile-card--outline {
  border-color: color-mix(in srgb, var(--accent) 56%, transparent);
  background: rgba(12, 7, 19, 0.24);
  backdrop-filter: blur(calc(var(--glass-blur) * 0.65));
}

a.profile-card {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) 40px;
  gap: 15px;
  align-items: center;
  min-height: 82px;
  padding: 12px 14px;
  transition:
    transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1),
    border-color 220ms ease,
    box-shadow 220ms ease;
}

a.profile-card:hover {
  z-index: 2;
  border-color: color-mix(in srgb, var(--accent) 52%, white 10%);
  box-shadow:
    0 24px 70px rgba(0, 0, 0, 0.28),
    0 0 38px color-mix(in srgb, var(--accent) 16%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transform: translateY(-4px) scale(1.008);
}

.profile-card__icon {
  display: grid;
  width: 56px;
  height: 56px;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--accent) 34%, transparent), rgba(255, 255, 255, 0.04));
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.16);
  font-size: 1.35rem;
}

.profile-card__icon img {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
}

.profile-card__copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 4px;
}

.profile-card__copy strong {
  overflow: hidden;
  font-size: 0.92rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-card__copy small {
  overflow: hidden;
  color: var(--text-soft);
  font-size: 0.72rem;
  font-weight: 550;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-card__arrow {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 50%;
  color: color-mix(in srgb, var(--accent) 65%, white);
  background: rgba(255, 255, 255, 0.055);
  transition: transform 200ms ease;
}

a.profile-card:hover .profile-card__arrow {
  transform: rotate(12deg) scale(1.08);
}

.profile-card--text {
  padding: 22px 24px;
}

.profile-card--text h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1rem;
}

.profile-card--text p {
  margin: 8px 0 0;
  color: var(--text-muted);
  font-size: 0.8rem;
  line-height: 1.65;
}

.profile-divider {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
  align-items: center;
  padding: 14px 5px 5px;
  animation: card-reveal 500ms both;
  animation-delay: calc(var(--item-order, 0) * 65ms);
}

.profile-divider span {
  height: 1px;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--accent) 65%, white));
}

.profile-divider span:last-child {
  transform: rotate(180deg);
}

.profile-divider strong {
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.profile-footer {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  margin-top: 34px;
  color: rgba(255, 255, 255, 0.34);
  font-size: 0.68rem;
  font-weight: 650;
}

.profile-footer img {
  width: 28px;
  height: 28px;
  border-radius: 9px;
}

.empty-message {
  margin: 0;
  padding: 24px;
  border-radius: 20px;
  color: var(--text-muted);
  text-align: center;
}

/* Anteprima compatta del pannello */

.profile-layout--compact {
  width: 100%;
  padding: 54px 16px 28px;
}

.profile-layout--compact .avatar-frame {
  width: 76px;
  height: 76px;
  margin-bottom: 15px;
  border-radius: 23px;
}

.profile-layout--compact .avatar-frame::before {
  border-radius: 22px;
}

.profile-layout--compact .avatar-frame img {
  border-radius: 19px;
}

.profile-layout--compact .status-dot {
  right: -3px;
  bottom: 4px;
  width: 16px;
  height: 16px;
  border-width: 3px;
}

.profile-layout--compact .profile-label {
  font-size: 0.48rem;
}

.profile-layout--compact .profile-header h1 {
  margin-top: 5px;
  font-size: 1.72rem;
}

.profile-layout--compact .profile-handle {
  margin-top: 6px;
  font-size: 0.62rem;
}

.profile-layout--compact .profile-bio {
  margin-top: 8px;
  font-size: 0.61rem;
  line-height: 1.5;
}

.profile-layout--compact .profile-items {
  gap: 8px;
  margin-top: 22px;
}

.profile-layout--compact a.profile-card {
  grid-template-columns: 39px minmax(0, 1fr) 28px;
  gap: 9px;
  min-height: 58px;
  padding: 8px 9px;
  border-radius: 17px;
}

.profile-layout--compact .profile-card__icon {
  width: 39px;
  height: 39px;
  border-radius: 12px;
  font-size: 0.95rem;
}

.profile-layout--compact .profile-card__copy {
  gap: 2px;
}

.profile-layout--compact .profile-card__copy strong {
  font-size: 0.66rem;
}

.profile-layout--compact .profile-card__copy small {
  font-size: 0.5rem;
}

.profile-layout--compact .profile-card__arrow {
  width: 27px;
  height: 27px;
  font-size: 0.66rem;
}

.profile-layout--compact .profile-card--text {
  padding: 13px;
  border-radius: 17px;
}

.profile-layout--compact .profile-card--text h2 {
  font-size: 0.68rem;
}

.profile-layout--compact .profile-card--text p {
  margin-top: 4px;
  font-size: 0.53rem;
}

.profile-layout--compact .profile-divider {
  gap: 7px;
  padding: 8px 4px 2px;
}

.profile-layout--compact .profile-divider strong {
  font-size: 0.46rem;
}

.profile-layout--compact .profile-footer {
  margin-top: 22px;
  font-size: 0.48rem;
}

.profile-layout--compact .profile-footer img {
  width: 23px;
  height: 23px;
  border-radius: 7px;
}

/* --------------------------------------------------------------------------
   Animazioni
   -------------------------------------------------------------------------- */

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

@keyframes grid-drift {
  to {
    background-position: 54px 54px;
  }
}

@keyframes orb-purple {
  from {
    transform: translate3d(-3%, -4%, 0) scale(0.95);
  }
  to {
    transform: translate3d(22%, 16%, 0) scale(1.12);
  }
}

@keyframes orb-orange {
  from {
    transform: translate3d(5%, 7%, 0) scale(1);
  }
  to {
    transform: translate3d(-18%, -20%, 0) scale(1.15);
  }
}

@keyframes orb-pink {
  from {
    transform: translate3d(-50%, -10%, 0);
  }
  to {
    transform: translate3d(-34%, 20%, 0);
  }
}

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

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
}

[data-motion="reduced"],
[data-motion="reduced"] *,
[data-motion="reduced"]::before,
[data-motion="reduced"]::after,
[data-motion="reduced"] *::before,
[data-motion="reduced"] *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
}

/* --------------------------------------------------------------------------
   Personalizzazioni avanzate: sfondo, gruppi, layout e card
   -------------------------------------------------------------------------- */

.animated-background::before,
.animated-background::after {
  position: absolute;
  z-index: 1;
  content: "";
  pointer-events: none;
}

.animated-background::before {
  inset: -35%;
  background: conic-gradient(
    from 90deg at 50% 50%,
    transparent 0 22%,
    color-mix(in srgb, var(--primary) 22%, transparent) 33%,
    transparent 48% 64%,
    color-mix(in srgb, var(--secondary) 18%, transparent) 76%,
    transparent 90%
  );
  filter: blur(54px);
  animation: background-spin calc(16s * var(--background-speed-factor)) linear infinite;
}

.animated-background::after {
  right: -10%;
  bottom: 7%;
  left: -10%;
  height: 34%;
  border: 1px solid color-mix(in srgb, var(--secondary) 20%, transparent);
  border-radius: 50%;
  opacity: 0.5;
  box-shadow:
    0 -24px 70px color-mix(in srgb, var(--primary) 12%, transparent),
    0 -72px 120px color-mix(in srgb, var(--secondary) 10%, transparent);
  animation: background-wave calc(5s * var(--background-speed-factor)) ease-in-out infinite alternate;
}

[data-background-effect="nebula"] .background-grid,
.preview-screen[data-background-effect="nebula"] .background-grid {
  opacity: 0.28;
}

[data-background-effect="nebula"] .color-orb,
.preview-screen[data-background-effect="nebula"] .color-orb {
  opacity: 0.6;
  filter: blur(140px);
}

[data-background-effect="waves"] .color-orb,
.preview-screen[data-background-effect="waves"] .color-orb {
  opacity: 0.2;
}

[data-background-effect="waves"] .animated-background::before,
.preview-screen[data-background-effect="waves"] .background-grid {
  border-radius: 42%;
  background: repeating-radial-gradient(
    ellipse at center,
    transparent 0 8%,
    color-mix(in srgb, var(--primary) 14%, transparent) 8.4% 9%,
    transparent 9.4% 15%
  );
}

[data-background-effect="none"] .color-orb,
[data-background-effect="none"] .background-grid,
[data-background-effect="none"] .animated-background::before,
[data-background-effect="none"] .animated-background::after,
.preview-screen[data-background-effect="none"] .background-ribbon,
.preview-screen[data-background-effect="none"] .color-orb,
.preview-screen[data-background-effect="none"] .background-grid {
  display: none;
}

.background-ribbon {
  position: absolute;
  z-index: 2;
  width: min(920px, 82vw);
  height: min(260px, 28vw);
  border: 1px solid color-mix(in srgb, var(--primary) 30%, transparent);
  border-radius: 50%;
  opacity: 0.46;
  filter: blur(1px);
  box-shadow:
    inset 0 0 42px color-mix(in srgb, var(--primary) 8%, transparent),
    0 0 65px color-mix(in srgb, var(--secondary) 8%, transparent);
  pointer-events: none;
  will-change: transform;
}

.background-ribbon--one {
  top: 14%;
  left: -24%;
  transform: rotate(18deg);
  animation: ribbon-one calc(7s * var(--background-speed-factor)) ease-in-out infinite alternate;
}

.background-ribbon--two {
  top: 48%;
  right: -30%;
  border-color: color-mix(in srgb, var(--secondary) 32%, transparent);
  animation: ribbon-two calc(9s * var(--background-speed-factor)) ease-in-out infinite alternate;
}

.background-ribbon--three {
  bottom: -6%;
  left: 4%;
  width: min(760px, 70vw);
  border-color: color-mix(in srgb, #e34ba9 25%, transparent);
  animation: ribbon-three calc(11s * var(--background-speed-factor)) ease-in-out infinite alternate;
}

[data-background-effect="nebula"] .background-ribbon {
  border-width: 20px;
  opacity: 0.16;
  filter: blur(22px);
}

[data-background-effect="waves"] .background-ribbon {
  height: 110px;
  border-width: 2px;
  opacity: 0.6;
}

[data-background-effect="none"] .background-ribbon {
  display: none;
}

[data-background-effect="none"] .animated-background,
.preview-screen[data-background-effect="none"] {
  animation: none;
}

.color-orb--purple {
  animation-duration: calc(8s * var(--background-speed-factor));
}

.color-orb--orange {
  animation-duration: calc(10s * var(--background-speed-factor));
}

.color-orb--pink {
  animation-duration: calc(7s * var(--background-speed-factor));
}

.background-grid {
  animation-duration: calc(9s * var(--background-speed-factor));
}

[data-motion="full"] .color-orb,
[data-motion="full"] .background-grid,
[data-motion="full"] .background-ribbon,
[data-motion="full"] .animated-background,
[data-motion="full"] .background-photo,
[data-motion="full"] .animated-background::before,
[data-motion="full"] .animated-background::after,
.preview-screen[data-motion="full"],
.preview-screen[data-motion="full"] .color-orb,
.preview-screen[data-motion="full"] .background-grid,
.preview-screen[data-motion="full"] .background-ribbon {
  animation-play-state: running !important;
}

.profile-layout {
  width: min(100%, var(--content-width));
}

.profile-items,
.profile-group__items {
  gap: var(--card-gap);
}

.social-links {
  display: flex;
  max-width: 100%;
  flex-wrap: wrap;
  gap: 9px;
  justify-content: center;
  margin-top: 20px;
}

.social-link {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 50%;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.13), transparent),
    color-mix(in srgb, var(--glass-color) var(--glass-opacity-percent), transparent);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.16), 0 10px 30px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(var(--glass-blur));
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.social-link:hover {
  border-color: color-mix(in srgb, var(--secondary) 55%, white);
  background: color-mix(in srgb, var(--primary) 24%, transparent);
  transform: translateY(-4px) rotate(4deg);
}

.social-link svg {
  width: 19px;
  height: 19px;
}

.profile-group {
  display: grid;
  grid-column: 1 / -1;
  animation: card-reveal 550ms both;
  animation-delay: calc(var(--item-order, 0) * 65ms);
}

.profile-group__heading {
  display: grid;
  grid-template-columns: minmax(22px, 1fr) auto minmax(22px, 1fr);
  gap: 13px;
  align-items: center;
  padding: 16px 5px var(--group-spacing);
  text-align: center;
}

.profile-group__heading > span {
  height: 1px;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--accent) 68%, white));
}

.profile-group__heading > span:last-child {
  transform: rotate(180deg);
}

.profile-group__heading h2 {
  margin: 0;
  color: rgba(255, 255, 255, 0.78);
  font-family: var(--font-display);
  font-size: 0.73rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.profile-group__heading p {
  margin: 4px 0 0;
  color: var(--text-soft);
  font-size: 0.62rem;
}

.profile-group__items {
  display: grid;
}

.profile-group[data-group-layout="grid"] .profile-group__items {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.profile-group[data-group-layout="carousel"] .profile-group__items {
  grid-auto-columns: minmax(190px, 44%);
  grid-auto-flow: column;
  overflow-x: auto;
  padding: 4px 3px 14px;
  scroll-snap-type: x mandatory;
  scrollbar-color: color-mix(in srgb, var(--primary) 45%, transparent) transparent;
}

.profile-group[data-group-layout="carousel"] .profile-card {
  scroll-snap-align: start;
}

.profile-group:is([data-group-layout="grid"], [data-group-layout="carousel"])
  .profile-card:not(.profile-card--text) {
  display: flex;
  min-height: 220px;
  flex-direction: column;
  gap: 13px;
  align-items: stretch;
  justify-content: flex-start;
  padding: 12px;
  text-align: center;
}

.profile-group:is([data-group-layout="grid"], [data-group-layout="carousel"])
  .profile-card__icon {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  border-radius: max(10px, calc(var(--corner-radius, 24px) - 8px));
}

.profile-group:is([data-group-layout="grid"], [data-group-layout="carousel"])
  .profile-card__icon--circle {
  width: min(100%, 132px);
  aspect-ratio: 1;
  align-self: center;
  border-radius: 50%;
}

.profile-group:is([data-group-layout="grid"], [data-group-layout="carousel"])
  .profile-card__icon--square {
  border-radius: 0;
}

.profile-group:is([data-group-layout="grid"], [data-group-layout="carousel"])
  .profile-card__icon--rounded {
  border-radius: max(10px, calc(var(--corner-radius, 24px) - 8px));
}

.profile-group:is([data-group-layout="grid"], [data-group-layout="carousel"])
  .profile-card__icon svg {
  width: 36px;
  height: 36px;
}

.profile-group:is([data-group-layout="grid"], [data-group-layout="carousel"])
  .profile-card__copy {
  align-items: center;
  padding: 2px 5px 8px;
}

.profile-group:is([data-group-layout="grid"], [data-group-layout="carousel"])
  .profile-card__copy small {
  display: -webkit-box;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.profile-group:is([data-group-layout="grid"], [data-group-layout="carousel"])
  .profile-card__arrow {
  position: absolute;
  top: 20px;
  right: 20px;
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(12, 7, 19, 0.62);
  backdrop-filter: blur(12px);
}

.profile-card {
  border-radius: var(--corner-radius, 24px);
}

.profile-card--glass {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.14), transparent 62%),
    color-mix(in srgb, var(--item-glass, var(--glass-color)) var(--item-glass-opacity, 18%), transparent);
}

.profile-card--gradient {
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: linear-gradient(
    var(--gradient-angle),
    color-mix(in srgb, var(--gradient-start) 86%, #171020),
    color-mix(in srgb, var(--gradient-end) 82%, #171020)
  );
  box-shadow: 0 20px 60px color-mix(in srgb, var(--gradient-start) 20%, transparent);
}

.profile-card:not(.profile-card--text) {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) 40px;
  gap: 15px;
  align-items: center;
  min-height: 82px;
  padding: 12px 14px;
}

.profile-card.is-disabled {
  cursor: not-allowed;
  filter: grayscale(0.55);
  opacity: 0.48;
}

.profile-card__icon svg {
  width: 24px;
  height: 24px;
}

.profile-card__icon--circle {
  border-radius: 50%;
}

.profile-card__icon--square {
  border-radius: 0;
}

.profile-card__icon--rounded {
  border-radius: 18px;
}

.profile-card--layout-featured:not(.profile-card--text) {
  min-height: 172px;
  grid-template-columns: 76px minmax(0, 1fr) 42px;
  align-items: end;
  padding: 24px;
}

.profile-card--layout-featured .profile-card__icon {
  width: 76px;
  height: 76px;
}

.profile-card--layout-compact:not(.profile-card--text) {
  min-height: 58px;
  grid-template-columns: 38px minmax(0, 1fr) 30px;
  gap: 10px;
  padding: 8px 10px;
}

.profile-card--layout-compact .profile-card__icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
}

.profile-card .profile-card__icon--circle {
  border-radius: 50%;
}

.profile-card .profile-card__icon--square {
  border-radius: 0;
}

.profile-card .profile-card__icon--rounded {
  border-radius: 18px;
}

.profile-card--layout-compact .profile-card__arrow {
  width: 29px;
  height: 29px;
}

.profile-card--priority-pulse {
  border-color: color-mix(in srgb, var(--accent) 55%, white);
}

.profile-card--priority-pulse::after,
.profile-card--priority-spotlight::after {
  position: absolute;
  z-index: 3;
  inset: 0;
  border-radius: inherit;
  content: "";
  pointer-events: none;
}

.profile-card--priority-pulse::after {
  border: 2px solid color-mix(in srgb, var(--accent) 74%, white);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 46%, transparent);
  animation: priority-pulse-ring calc(1.8s * var(--background-speed-factor)) ease-out infinite;
}

.profile-card--priority-spotlight {
  border-color: color-mix(in srgb, var(--accent) 72%, white);
  box-shadow:
    0 22px 70px color-mix(in srgb, var(--accent) 32%, transparent),
    inset 0 1px rgba(255, 255, 255, 0.25);
}

.profile-card--priority-spotlight::after {
  inset: -70% -45%;
  background: linear-gradient(
    105deg,
    transparent 36%,
    rgba(255, 255, 255, 0.04) 43%,
    rgba(255, 255, 255, 0.46) 50%,
    rgba(255, 255, 255, 0.04) 57%,
    transparent 64%
  );
  transform: translateX(-52%) rotate(8deg);
  animation: priority-spotlight-sweep 2.7s ease-in-out infinite;
}

.profile-layout[data-layout="grid"] .profile-items {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.profile-layout[data-layout="grid"] .profile-card:not(.profile-card--text) {
  min-width: 0;
  grid-template-columns: 48px minmax(0, 1fr) 32px;
  gap: 10px;
}

.profile-layout[data-layout="compact"] .profile-items {
  gap: max(4px, calc(var(--card-gap) * 0.62));
}

.profile-layout[data-layout="compact"] .profile-card:not(.profile-card--text) {
  min-height: 62px;
  grid-template-columns: 42px minmax(0, 1fr) 30px;
  padding: 8px 10px;
}

.profile-layout[data-layout="compact"] .profile-card__icon {
  width: 42px;
  height: 42px;
}

.profile-layout--compact .social-links {
  gap: 5px;
  margin-top: 10px;
}

.profile-layout--compact .social-link {
  width: 28px;
  height: 28px;
}

.profile-layout--compact .social-link svg {
  width: 13px;
  height: 13px;
}

.profile-layout--compact .profile-group__heading {
  gap: 7px;
  padding: 8px 3px var(--group-spacing);
}

.profile-layout--compact .profile-group__heading h2 {
  font-size: 0.46rem;
}

.profile-layout--compact .profile-group__heading p {
  font-size: 0.42rem;
}

@keyframes background-spin {
  to { transform: rotate(360deg) scale(1.08); }
}

@keyframes background-breathe {
  from { background-position: 20% -8%, 0 0; }
  to { background-position: 80% 24%, 0 0; }
}

@keyframes photo-drift {
  from { transform: scale(1.08) translate3d(-1.5%, -1%, 0); }
  to { transform: scale(1.15) translate3d(1.5%, 1.5%, 0); }
}

@keyframes background-wave {
  from { transform: translateY(12%) scaleX(0.9); }
  to { transform: translateY(-8%) scaleX(1.12); }
}

@keyframes priority-pulse-ring {
  0% {
    opacity: 0.9;
    background: color-mix(in srgb, var(--accent) 3%, transparent);
    box-shadow: inset 0 0 0 0 color-mix(in srgb, var(--accent) 48%, transparent);
  }
  55% {
    opacity: 1;
    background: color-mix(in srgb, var(--accent) 10%, transparent);
    box-shadow: inset 0 0 30px color-mix(in srgb, var(--accent) 22%, transparent);
  }
  100% {
    opacity: 0.25;
    background: transparent;
    box-shadow: inset 0 0 0 14px transparent;
  }
}

@keyframes priority-spotlight-sweep {
  0%, 18% { transform: translateX(-58%) rotate(8deg); opacity: 0; }
  28% { opacity: 1; }
  72% { opacity: 1; }
  82%, 100% { transform: translateX(58%) rotate(8deg); opacity: 0; }
}

@keyframes ribbon-one {
  from { transform: translate3d(-16%, -14%, 0) rotate(8deg) scale(0.86); }
  to { transform: translate3d(42%, 32%, 0) rotate(34deg) scale(1.2); }
}

@keyframes ribbon-two {
  from { transform: translate3d(22%, -12%, 0) rotate(-26deg) scale(0.94); }
  to { transform: translate3d(-38%, 26%, 0) rotate(2deg) scale(1.22); }
}

@keyframes ribbon-three {
  from { transform: translate3d(-12%, 4%, 0) rotate(8deg); }
  to { transform: translate3d(18%, -26%, 0) rotate(-16deg); }
}

@media (max-width: 600px) {
  .profile-layout[data-layout="grid"] .profile-items {
    grid-template-columns: 1fr;
  }

  .profile-card:not(.profile-card--text) {
    grid-template-columns: 48px minmax(0, 1fr) 34px;
    gap: 11px;
    min-height: 72px;
    padding: 10px 11px;
  }

  .profile-card--layout-featured:not(.profile-card--text) {
    min-height: 148px;
    grid-template-columns: 64px minmax(0, 1fr) 36px;
    padding: 18px;
  }

  .profile-group[data-group-layout="grid"] .profile-group__items {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .profile-group[data-group-layout="carousel"] .profile-group__items {
    grid-auto-columns: minmax(168px, 76%);
  }

  .profile-group:is([data-group-layout="grid"], [data-group-layout="carousel"])
    .profile-card:not(.profile-card--text) {
    min-height: 190px;
    padding: 9px;
  }

  .profile-card__copy strong,
  .profile-card__copy small {
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
  }

  .profile-card__copy small {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }
}

@media (max-width: 440px) {
  .profile-group[data-group-layout="grid"] .profile-group__items {
    grid-template-columns: 1fr;
  }

  .profile-group[data-group-layout="carousel"] .profile-group__items {
    grid-auto-columns: minmax(164px, 88%);
  }
}
