@font-face {
  font-family: "Paperlogy";
  src: url("./assets/fonts/Paperlogy-1Thin.ttf") format("truetype");
  font-weight: 100;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Paperlogy";
  src: url("./assets/fonts/Paperlogy-2ExtraLight.ttf") format("truetype");
  font-weight: 200;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Paperlogy";
  src: url("./assets/fonts/Paperlogy-3Light.ttf") format("truetype");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Paperlogy";
  src: url("./assets/fonts/Paperlogy-4Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Paperlogy";
  src: url("./assets/fonts/Paperlogy-5Medium.ttf") format("truetype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Paperlogy";
  src: url("./assets/fonts/Paperlogy-6SemiBold.ttf") format("truetype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Paperlogy";
  src: url("./assets/fonts/Paperlogy-7Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Paperlogy";
  src: url("./assets/fonts/Paperlogy-8ExtraBold.ttf") format("truetype");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Paperlogy";
  src: url("./assets/fonts/Paperlogy-9Black.ttf") format("truetype");
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --profile-photo: url("./assets/profile-photo.svg");
  --primary: #0066cc;
  --theme-bg-start: #111821;
  --theme-bg-middle: #33475d;
  --theme-bg-end: #eef2f7;
  --theme-bg-image: none;
  --theme-bg-image-opacity: 0;
  --theme-card: #ffffff;
  --theme-card-text: #111113;
  --canvas: #ffffff;
  --canvas-parchment: #f5f5f7;
  --surface-black: #0f1114;
  --surface-panel: #15181d;
  --ink: #111113;
  --ink-muted: #6e6e73;
  --frost: rgba(245, 245, 247, 0.84);
  --hairline: rgba(0, 0, 0, 0.07);
  --shadow-product: 0 18px 48px rgba(0, 0, 0, 0.24);
  --shadow-soft: 0 14px 34px rgba(15, 23, 32, 0.12);
  --shadow-pressed: 0 7px 18px rgba(15, 23, 32, 0.11);
  --profile-button-gap: 42px;
  --button-gap: 18px;
  --share-gap: 32px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  min-height: -webkit-fill-available;
  background-color: var(--theme-bg-end);
  background:
    radial-gradient(circle at 50% -8%, rgba(255, 255, 255, 0.2), transparent 34%),
    linear-gradient(180deg, var(--theme-bg-start) 0%, var(--theme-bg-middle) 48%, var(--theme-bg-end) 100%);
  background-color: var(--theme-bg-end);
  overscroll-behavior-y: none;
}

body {
  min-height: 100%;
  min-height: -webkit-fill-available;
  margin: 0;
  background-color: var(--theme-bg-end);
  background:
    radial-gradient(circle at 50% -8%, rgba(255, 255, 255, 0.2), transparent 34%),
    linear-gradient(180deg, var(--theme-bg-start) 0%, var(--theme-bg-middle) 48%, var(--theme-bg-end) 100%);
  background-color: var(--theme-bg-end);
  color: #ffffff;
  font-family: "Paperlogy", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  word-break: keep-all;
  overflow-wrap: break-word;
  overscroll-behavior-y: none;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% -8%, rgba(255, 255, 255, 0.2), transparent 34%),
    linear-gradient(180deg, var(--theme-bg-start) 0%, var(--theme-bg-middle) 48%, var(--theme-bg-end) 100%);
}

button,
a {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

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

.profile-page {
  position: relative;
  isolation: isolate;
  width: min(100%, 480px);
  min-height: 100svh;
  margin: 0 auto;
  padding: 26px 20px 42px;
  overflow: hidden;
  background-color: var(--theme-bg-end);
  background:
    radial-gradient(circle at 50% -8%, rgba(255, 255, 255, 0.22), transparent 36%),
    linear-gradient(180deg, var(--theme-bg-start) 0%, var(--theme-bg-middle) 48%, var(--theme-bg-end) 100%);
  background-color: var(--theme-bg-end);
}

.profile-page::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  z-index: 0;
  height: min(58svh, 460px);
  pointer-events: none;
  background-image:
    linear-gradient(180deg, rgba(10, 14, 20, 0.12) 0%, rgba(10, 14, 20, 0.2) 42%, rgba(10, 14, 20, 0) 100%),
    var(--theme-bg-image);
  background-position:
    center top,
    center top;
  background-repeat: no-repeat;
  background-size: cover;
  opacity: var(--theme-bg-image-opacity);
  -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 56%, rgba(0, 0, 0, 0.68) 76%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 0%, #000 56%, rgba(0, 0, 0, 0.68) 76%, transparent 100%);
}

.profile-page::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 22%),
    radial-gradient(circle at 50% 100%, rgba(255, 255, 255, 0.32), transparent 38%);
  mix-blend-mode: soft-light;
  opacity: 0.68;
}

.hero {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: -26px -20px 0;
  padding: 42px 20px var(--profile-button-gap);
  overflow: hidden;
}

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

.link-row:focus-visible,
.share-bottom:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 4px;
}

.portrait {
  position: relative;
  width: 116px;
  height: 116px;
  margin: 0 auto 24px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 0;
  border-radius: 50%;
  background: #1d2026;
  box-shadow:
    inset 0 0 0 0.5px rgba(255, 255, 255, 0.18),
    0 18px 42px rgba(0, 0, 0, 0.24);
  backface-visibility: hidden;
  clip-path: inset(0 round 999px);
  contain: paint;
  transform: translateZ(0);
  -webkit-mask-image: -webkit-radial-gradient(white, black);
}

.photo-shape-rounded .portrait {
  border-radius: 32px;
  clip-path: inset(0 round 32px);
}

.portrait::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: inherit;
  background: var(--profile-photo) center / cover no-repeat;
  opacity: 0;
  transform: scale(1.006) translateZ(0);
}

.has-custom-photo .portrait::before {
  opacity: 1;
}

.portrait::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  border-radius: inherit;
  box-shadow:
    inset 0 0 0 0.5px rgba(255, 255, 255, 0.22),
    inset 0 0 0 1px rgba(0, 0, 0, 0.035);
  pointer-events: none;
}

.portrait-image {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: block;
  border-radius: inherit;
  object-fit: cover;
  opacity: 0;
  backface-visibility: hidden;
  image-rendering: auto;
  transform: scale(1.006) translateZ(0);
}

.portrait-image[hidden] {
  display: none;
}

.has-custom-photo .portrait-image {
  opacity: 1;
}

.portrait span {
  position: relative;
  z-index: 2;
  color: #ffffff;
  font-size: 30px;
  font-weight: 700;
  line-height: 1;
}

.has-custom-photo .portrait span {
  opacity: 0;
}

.photo-off .portrait {
  display: none;
}

.photo-off .hero {
  padding-top: 68px;
  padding-bottom: var(--profile-button-gap);
}

.intro {
  max-width: 370px;
  padding: 0 12px;
  text-align: center;
}

.intro h1 {
  margin: 0 0 12px;
  color: #ffffff;
  font-size: clamp(32px, 7.6vw, 40px);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: 0;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.18);
}

.profile-role {
  margin: 0 0 17px;
  color: rgba(255, 255, 255, 0.88);
  font-size: clamp(17px, 4.4vw, 21px);
  font-weight: 600;
  line-height: 1.3;
}

.profile-lines {
  display: grid;
  gap: 6px;
}

.profile-lines p {
  margin: 0;
  color: rgba(255, 255, 255, 0.7);
  font-size: clamp(15px, 4vw, 17px);
  font-weight: 400;
  line-height: 1.56;
}

.link-area {
  position: relative;
  z-index: 3;
}

.link-list {
  display: grid;
  gap: var(--button-gap);
  position: relative;
  z-index: 2;
  margin-top: 0;
  padding-top: 0;
}

.link-row {
  min-height: 74px;
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) 16px;
  align-items: center;
  gap: 14px;
  padding: 12px 18px 12px 14px;
  border: 1px solid var(--hairline);
  border-radius: 24px;
  background: color-mix(in srgb, var(--theme-card) 88%, transparent);
  color: var(--theme-card-text);
  overflow: hidden;
  touch-action: manipulation;
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.44),
    var(--shadow-soft);
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background 180ms ease,
    box-shadow 180ms ease;
}

.link-row:hover {
  border-color: color-mix(in srgb, var(--primary) 32%, transparent);
  background: color-mix(in srgb, var(--theme-card) 94%, transparent);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.52),
    0 18px 36px rgba(15, 23, 32, 0.16);
  transform: translateY(-2px);
}

.link-row.is-pressed,
.link-row:active {
  background: color-mix(in srgb, var(--theme-card) 78%, var(--primary) 10%);
  box-shadow: var(--shadow-pressed);
  transform: translateY(1px) scale(0.985);
}

.link-row::after {
  content: "";
  width: 7px;
  height: 7px;
  justify-self: end;
  border-top: 1.7px solid rgba(17, 17, 19, 0.26);
  border-right: 1.7px solid rgba(17, 17, 19, 0.26);
  transform: rotate(45deg);
}

.link-icon {
  width: 48px;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  justify-self: center;
  align-self: center;
  border-radius: 16px;
  background: color-mix(in srgb, var(--theme-card) 70%, #f5f5f7 30%);
  color: var(--primary);
  overflow: hidden;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.5),
    inset 0 0 0 1px rgba(255, 255, 255, 0.34);
  transition:
    transform 180ms ease,
    background 180ms ease,
    color 180ms ease;
}

.link-row:hover .link-icon {
  background: color-mix(in srgb, var(--primary) 12%, #f5f5f7);
  transform: scale(1.04);
}

.link-icon svg {
  width: 25px;
  height: 25px;
  display: block;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.85;
  transform: translateZ(0);
}

.link-icon svg * {
  vector-effect: non-scaling-stroke;
}

.link-icons-off .link-row {
  grid-template-columns: minmax(0, 1fr) 16px;
  padding-left: 22px;
}

.link-icons-off .link-icon {
  display: none;
}

.link-label {
  justify-self: start;
  color: var(--theme-card-text);
  font-size: clamp(17px, 4.4vw, 19px);
  font-weight: 600;
  line-height: 1.3;
  text-align: left;
}

.quick-dock {
  display: grid;
  place-items: center;
  padding: var(--share-gap) 0 14px;
  position: relative;
  z-index: 3;
}

.share-bottom {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 19px;
  border: 1px solid rgba(0, 102, 204, 0.22);
  border-radius: 9999px;
  background: color-mix(in srgb, var(--theme-card) 88%, transparent);
  color: var(--primary);
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
  touch-action: manipulation;
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.46),
    0 10px 26px rgba(0, 102, 204, 0.12);
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background 180ms ease,
    box-shadow 180ms ease;
}

.share-bottom:hover {
  border-color: rgba(0, 102, 204, 0.42);
  background: color-mix(in srgb, var(--theme-card) 94%, var(--primary) 6%);
  box-shadow: 0 12px 24px rgba(0, 102, 204, 0.16);
  transform: translateY(-2px);
}

.share-bottom.is-pressed,
.share-bottom:active {
  background: color-mix(in srgb, var(--theme-card) 78%, var(--primary) 10%);
  box-shadow: var(--shadow-pressed);
  transform: translateY(1px) scale(0.985);
}

.share-bottom svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 10;
  margin: 0;
  padding: 10px 16px;
  border-radius: 9999px;
  background: rgba(17, 21, 24, 0.86);
  color: #ffffff;
  font-size: 14px;
  line-height: 1.3;
  opacity: 0;
  transform: translate(-50%, 10px);
  transition: opacity 180ms ease, transform 180ms ease;
  pointer-events: none;
}

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

@media (min-width: 481px) {
  body {
    padding: 22px 0;
    background: var(--surface-black);
  }

  .profile-page {
    min-height: calc(100svh - 44px);
    border-radius: 32px;
    box-shadow: var(--shadow-product);
  }

  .hero {
    border-radius: 32px 32px 0 0;
  }
}

@media (max-width: 480px) {
  html,
  body {
    width: 100%;
    height: 100%;
    overflow: hidden;
  }

  body {
    position: fixed;
    inset: 0;
    padding: 0;
  }

  .profile-page {
    position: fixed;
    inset: 0;
    width: 100%;
    height: auto;
    min-height: 0;
    max-height: none;
    padding-top: max(22px, env(safe-area-inset-top));
    padding-bottom: max(88px, calc(env(safe-area-inset-bottom) + 48px));
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior-y: none;
    -webkit-overflow-scrolling: touch;
  }
}

@supports (height: 100dvh) {
  @media (max-width: 480px) {
    .profile-page {
      height: auto;
      min-height: 0;
      max-height: none;
    }
  }
}

@media (max-width: 390px) {
  .profile-page {
    padding-left: 16px;
    padding-right: 16px;
  }

  .portrait {
    width: 106px;
    height: 106px;
  }

  .link-row {
    min-height: 70px;
    grid-template-columns: 52px minmax(0, 1fr) 16px;
    gap: 12px;
    padding: 11px 16px 11px 12px;
    border-radius: 20px;
  }

  .link-icon {
    width: 46px;
    height: 46px;
    border-radius: 15px;
  }

  .link-icon svg {
    width: 24px;
    height: 24px;
  }

  .link-icons-off .link-row {
    grid-template-columns: minmax(0, 1fr) 16px;
    padding-left: 18px;
  }
}

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