:root {
  color-scheme: dark;
  --page-max-width: 520px;
  --page-padding: 18px;
  --color-page: #0c0c0e;
  --color-text: #f4f3f1;
  --color-muted: #8e8d93;
  --color-surface: #222225;
  --color-surface-hover: #28282c;
  --color-border: rgba(255, 255, 255, 0.11);
  --color-modal: #171719;
  --radius-card: 14px;
  --radius-modal: 20px;
  --shadow-card: 0 12px 30px rgba(0, 0, 0, 0.2);
  --shadow-modal: 0 24px 80px rgba(0, 0, 0, 0.6);
  --transition-fast: 180ms cubic-bezier(.2, .8, .2, 1);
  --transition-modal: 260ms cubic-bezier(.2, .8, .2, 1);
}

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

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--color-page);
}

body {
  min-width: 320px;
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  overflow-x: hidden;
  background: var(--color-page);
  color: var(--color-text);
  font-family: "Figtree", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
a {
  font: inherit;
}

button {
  color: inherit;
}

.ambient-background {
  position: fixed;
  inset: -48px;
  z-index: -2;
  background-color: #242126;
  filter: blur(30px) saturate(0.72);
  transform: scale(1.08);
}

.ambient-background img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ambient-background::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(5, 5, 7, 0.48);
}

.profile-page {
  width: min(100%, var(--page-max-width));
  min-height: 100vh;
  min-height: 100svh;
  margin-inline: auto;
  padding-bottom: calc(48px + env(safe-area-inset-bottom));
  background: var(--color-page);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.025), 0 0 70px rgba(0, 0, 0, 0.26);
  animation: page-in 320ms ease-out both;
}

.hero {
  position: relative;
  width: 100%;
  height: calc(min(100vw, var(--page-max-width)) + 58px);
  overflow: hidden;
}

.hero__media {
  width: 100%;
  height: min(100vw, var(--page-max-width));
}

.hero__image {
  width: 100%;
  height: 100%;
}

.image-fallback {
  overflow: hidden;
  background:
    radial-gradient(circle at 68% 18%, rgba(236, 204, 157, 0.72), transparent 28%),
    radial-gradient(circle at 38% 12%, rgba(213, 78, 196, 0.72), transparent 32%),
    linear-gradient(145deg, #39323c, #19191c 72%);
}

.hero__image {
  display: block;
  object-fit: cover;
  object-position: center 28%;
}

.image-fallback.is-missing img {
  visibility: hidden;
}

.hero__shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 48%, rgba(12, 12, 14, 0.12) 61%, var(--color-page) 91%);
  pointer-events: none;
}

.online-pill {
  position: absolute;
  top: calc(16px + env(safe-area-inset-top));
  left: 16px;
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 32px;
  padding: 7px 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  background: rgba(38, 36, 43, 0.75);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(12px);
  font-size: 12px;
  font-weight: 600;
}

.online-pill__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #3bd677;
  box-shadow: 0 0 0 3px rgba(59, 214, 119, 0.12);
}

.identity {
  position: absolute;
  inset-inline: var(--page-padding);
  bottom: 2px;
  z-index: 1;
  text-align: center;
}

.identity__name {
  margin: 0;
  font-size: clamp(25px, 7vw, 29px);
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 1.1;
}

.identity__username {
  margin: 24px 0 0;
  color: var(--color-muted);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.25;
}

.identity__bio {
  max-width: 360px;
  margin: 9px auto 0;
  color: #b7b5ba;
  font-size: 14px;
  line-height: 1.4;
}

.links-section {
  padding: 34px var(--page-padding) 0;
}

.links-list {
  display: grid;
  gap: 11px;
}

.link-card {
  position: relative;
  display: flex;
  width: 100%;
  min-height: 64px;
  align-items: center;
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  background: var(--color-surface);
  box-shadow: var(--shadow-card);
  color: var(--color-text);
  cursor: pointer;
  text-align: left;
  text-decoration: none;
  transition:
    transform var(--transition-fast),
    border-color var(--transition-fast),
    background-color var(--transition-fast),
    box-shadow var(--transition-fast);
  -webkit-tap-highlight-color: transparent;
}

.link-card--simple {
  padding: 0 18px;
}

.link-card--featured {
  height: clamp(227px, calc((100vw - (2 * var(--page-padding))) / 1.65 + 50px), 343px);
  align-items: flex-end;
  border-color: rgba(255, 255, 255, 0.08);
}

.link-card__image,
.link-card__image-fallback {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.link-card__image-fallback {
  background:
    radial-gradient(circle at 25% 22%, rgba(216, 78, 198, 0.7), transparent 35%),
    radial-gradient(circle at 88% 22%, rgba(235, 198, 128, 0.55), transparent 30%),
    linear-gradient(150deg, #37323d, #16171a);
}

.link-card__image {
  display: block;
  object-fit: cover;
}

.link-card--featured .link-card__image {
  object-position: center 34%;
}

.link-card__image-fallback.is-missing img {
  visibility: hidden;
}

.link-card--featured::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 45%, rgba(6, 6, 8, 0.76));
}

.link-card__label {
  position: relative;
  z-index: 1;
  min-width: 0;
  padding-right: 12px;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.link-card--featured .link-card__label {
  width: 100%;
  padding: 0 54px 19px 18px;
  text-align: center;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
}

.link-card__icon {
  width: 18px;
  height: 18px;
  margin-left: auto;
  flex: 0 0 auto;
  color: #8d8d92;
}

.link-card--featured .link-card__icon {
  position: absolute;
  top: 15px;
  right: 15px;
  z-index: 2;
  width: 36px;
  height: 36px;
  padding: 9px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.94);
  color: #17171a;
  box-shadow: 0 5px 16px rgba(0, 0, 0, 0.22);
}

.link-card:focus-visible,
.modal-close:focus-visible,
.consent-button:focus-visible {
  outline: 3px solid #82dfff;
  outline-offset: 3px;
}

.link-card:active {
  transform: scale(0.985);
}

.consent-layer {
  position: fixed;
  inset: 0;
  z-index: 2147483647;
  display: flex;
  align-items: center;
  justify-content: center;
  padding:
    max(18px, env(safe-area-inset-top))
    18px
    max(18px, env(safe-area-inset-bottom));
}

.consent-layer[hidden] {
  display: none;
}

.consent-layer.is-closing {
  pointer-events: none;
}

.consent-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.76);

}

.consent-modal {
  position: relative;
  z-index: 1;
  width: min(100%, 410px);
  max-height: calc(100svh - 36px);
  overflow-y: auto;
  padding: 32px 28px 27px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-modal);
  background: var(--color-modal);
  box-shadow: var(--shadow-modal);
  text-align: center;
  opacity: 1;
  visibility: visible;
  transform: none;
  animation: none;
}

.modal-close {
  position: absolute;
  top: 13px;
  right: 13px;
  display: grid;
  width: 40px;
  height: 40px;
  padding: 10px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #aaa9ae;
  cursor: pointer;
}

.modal-close svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 1.8;
}

.consent-icon {
  display: grid;
  width: 62px;
  height: 62px;
  margin: 4px auto 20px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 50%;
  background: #222225;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.consent-modal h2 {
  margin: 0;
  font-size: 25px;
  letter-spacing: -0.035em;
  line-height: 1.15;
}

.consent-modal p {
  margin: 14px auto 24px;
  color: #aaa9ae;
  font-size: 15px;
  line-height: 1.5;
}

.consent-actions {
  display: grid;
  gap: 10px;
}

.consent-button {
  min-height: 50px;
  padding: 12px 18px;
  border: 1px solid transparent;
  border-radius: 12px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 650;
  transition: transform var(--transition-fast), background-color var(--transition-fast);
}

.consent-button--primary {
  background: #f7f7f7;
  color: #0b0b0d;
}

.consent-button--secondary {
  border-color: var(--color-border);
  background: #222225;
  color: #f1f0ee;
}

.consent-button:active {
  transform: scale(0.98);
}


@keyframes page-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes backdrop-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes backdrop-out {
  from { opacity: 1; }
  to { opacity: 0; }
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(10px) scale(0.975); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes modal-out {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(6px) scale(0.985); }
}

@media (hover: hover) and (pointer: fine) {
  .link-card:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.19);
    background: var(--color-surface-hover);
    box-shadow: 0 16px 34px rgba(0, 0, 0, 0.28);
  }

  .link-card:active {
    transform: translateY(0) scale(0.985);
  }

  .modal-close:hover {
    background: rgba(255, 255, 255, 0.07);
    color: #fff;
  }

  .consent-button--primary:hover {
    background: #fff;
  }

  .consent-button--secondary:hover {
    background: #2a2a2e;
  }
}

@media (min-width: 521px) {
  .links-section {
    padding-top: 36px;
  }
}

@media (max-width: 360px) {
  :root {
    --page-padding: 14px;
  }

  .identity__username {
    margin-top: 19px;
  }

  .links-section {
    padding-top: 28px;
  }

  .consent-modal {
    padding-inline: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }
}

/* Stable inline consent panel */
.consent-layer {
  position: static;
  inset: auto;
  z-index: auto;
  display: block;
  width: 100%;
  padding: 0;
}

.consent-layer[hidden] {
  display: none;
}

.consent-backdrop {
  display: none;
}

.consent-modal {
  width: 100%;
  max-height: none;
  padding: 28px 24px 24px;
  border-radius: var(--radius-card);
  opacity: 1;
  visibility: visible;
  transform: none;
  animation: none;
}

/* Native no-JavaScript consent controls */
.link-consent {
  display: block;
  width: 100%;
}

.link-consent > summary {
  list-style: none;
}

.link-consent > summary::-webkit-details-marker {
  display: none;
}

.link-card__native-icon {
  position: relative;
  z-index: 2;
  margin-left: auto;
  color: #8d8d92;
  font-size: 19px;
  line-height: 1;
}

.link-card--featured .link-card__native-icon {
  position: absolute;
  top: 15px;
  right: 15px;
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.94);
  color: #17171a;
  font-size: 15px;
}

.inline-consent {
  display: grid;
  width: 100%;
  gap: 10px;
  margin-top: 10px;
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-card);
  background: #171719;
  box-shadow: var(--shadow-card);
  text-align: center;
}

.inline-consent strong {
  font-size: 21px;
}

.inline-consent p {
  margin: 0 0 8px;
  color: #aaa9ae;
  font-size: 15px;
  line-height: 1.5;
}

.inline-consent .consent-button {
  display: grid;
  place-items: center;
  text-decoration: none;
}
