:root {
  color-scheme: light only;
  --color-card: #ffffff;
  --color-edge: #d3d5d8;
  --color-text: #50535a;
  --color-border: #b4b7bd;
  --color-muted: #686b72;
  --color-accent: #b9433f;
  --color-line: rgba(52, 54, 59, 0.16);
  --ease-out: cubic-bezier(0.22, 0.8, 0.24, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

.page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 40px 20px;
  font-family: "Playfair Display", Georgia, serif;
  color: var(--color-text);
  background: #fff url("images/wallpaper.jpg") center / cover fixed no-repeat;
}

.layout {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: center;
}

.layout__side {
  display: flex;
  flex-direction: column;
  gap: 26px;
  width: min(320px, 86vw);
  margin: 0 0 44px 44px;
}

.card {
  position: relative;
  width: min(440px, 86vw);
  aspect-ratio: 4 / 5.4;
  background: var(--color-card);
  border: 2px solid var(--color-border);
  border-radius: 30px;
  box-shadow:
    14px 14px 0 var(--color-edge),
    0 40px 70px -24px rgba(40, 44, 54, 0.35);
}

.card__tag {
  position: absolute;
  top: 24px;
  font-size: 16px;
  font-weight: 600;
}

.card__tag--left {
  left: 28px;
  font-style: italic;
}

.card__tag--right {
  right: 28px;
  font-weight: 500;
  color: var(--color-muted);
}

.card__figure {
  position: absolute;
  left: 50%;
  bottom: 5%;
  height: 87%;
  transform: translateX(-50%);
}

.card__hero {
  display: block;
  height: 100%;
  width: auto;
  filter: drop-shadow(0 24px 20px rgba(50, 54, 64, 0.35));
}

.profile {
  width: 100%;
  padding: 28px 30px 12px;
  background: var(--color-card);
  border: 1.5px solid var(--color-border);
  border-radius: 22px;
  box-shadow: 8px 8px 0 var(--color-edge);
}

.profile__header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}

.profile__avatar {
  display: block;
  width: 56px;
  height: 56px;
  object-fit: contain;
}

.profile__name {
  font-size: 44px;
  font-weight: 700;
  font-style: italic;
  line-height: 1;
}

.profile__row {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 0;
  border-top: 1px solid var(--color-line);
}

.profile__term {
  font-size: 16px;
  color: var(--color-muted);
}

.profile__value {
  font-size: 17px;
  font-weight: 500;
  line-height: 1.5;
  text-align: right;
}

.links {
  padding: 20px 22px 10px;
  background: var(--color-card);
  border: 1.5px solid var(--color-border);
  border-radius: 22px;
  box-shadow: 8px 8px 0 var(--color-edge);
}

.links__title {
  margin-bottom: 6px;
  font-size: 16px;
  font-weight: 500;
  color: var(--color-muted);
}

.links__item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  margin: 0 -8px;
  padding: 12px 8px;
  border-top: 1px solid var(--color-line);
  border-radius: 10px;
  color: var(--color-text);
  text-decoration: none;
}

.links__item:hover {
  background: #f1f2f3;
}

.links__item:focus-visible {
  outline: 2px solid var(--color-border);
  outline-offset: 2px;
}

.links__name {
  font-size: 17px;
  font-weight: 500;
}

.links__handle {
  font-size: 15px;
  color: var(--color-muted);
  text-align: right;
  overflow-wrap: anywhere;
}

.footnote {
  margin-top: -8px;
  font-size: 13px;
  font-style: italic;
  color: var(--color-muted);
  text-align: right;
  opacity: 0.7;
}

.footnote__heart {
  color: var(--color-accent);
}

@media (max-width: 900px) {
  .page {
    background-attachment: scroll;
  }

  .layout {
    flex-direction: column;
    align-items: center;
  }

  .layout__side {
    width: min(300px, 80vw);
    margin: 28px 0 0 72px;
  }
}

@media (max-width: 360px) {
  .layout__side {
    margin-left: 24px;
  }

  .profile__name {
    font-size: 36px;
  }
}

.card {
  animation: card-in 1s var(--ease-out) both;
}

.card__backdrop {
  position: absolute;
  left: 50%;
  top: 9%;
  bottom: 3%;
  width: 86%;
  transform: translateX(-50%);
  transform-origin: 50% 100%;
  background: #f1f2f3 url("images/wallpaper.jpg") 20% 30% / 320% auto;
  border: 1.5px solid var(--color-border);
  border-radius: 24px;
  box-shadow:
    0 0 0 7px #fff,
    0 0 0 8px var(--color-line);
  animation:
    capsule-in 1.1s var(--ease-out) 0.3s both,
    drift 40s ease-in-out 1.4s infinite alternate;
}

.card__tag {
  animation: fade 1s ease 1.9s both;
}

.card__hero {
  animation: hero-in 1.7s var(--ease-out) 0.6s both;
}

.profile {
  animation: fade 1s ease 2.2s both;
}

.links {
  animation: fade 1s ease 2.4s both;
}

.footnote {
  animation: fade 1s ease 2.6s both;
}

@keyframes card-in {
  from {
    opacity: 0;
    transform: translateY(32px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes capsule-in {
  from {
    opacity: 0;
    transform: translateX(-50%) scaleY(0.15);
  }
  to {
    opacity: 1;
    transform: translateX(-50%);
  }
}

@keyframes drift {
  to {
    background-position: 85% 70%;
  }
}

@keyframes fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes pop {
  from {
    opacity: 0;
    transform: scale(0.6);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes hero-in {
  0% {
    opacity: 0;
    clip-path: inset(100% 0 0 0);
    filter: blur(14px) drop-shadow(0 24px 20px rgba(50, 54, 64, 0));
    transform: translateY(40px) scale(0.96);
  }
  60% {
    opacity: 1;
  }
  100% {
    opacity: 1;
    clip-path: inset(-20% -20% 0 -20%);
    filter: blur(0) drop-shadow(0 24px 20px rgba(50, 54, 64, 0.35));
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
  }
}

.effect {
  position: absolute;
  left: calc(var(--x) * 1%);
  top: calc(var(--y) * 1%);
  width: calc(var(--size) * 1%);
  aspect-ratio: 1;
  overflow: hidden;
  border: 1px solid rgba(150, 154, 162, 0.55);
  animation: pop 0.7s var(--ease-out) both;
  animation-delay: calc(2s + var(--order) * 0.15s);
}

.effect--hidden {
  display: none;
}

.effect__canvas {
  display: block;
  width: 100%;
  height: 100%;
  opacity: 0.8;
}

.effect--blur {
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(3px);
}

.effect--invert {
  backdrop-filter: invert(0.35) grayscale(1);
}

.effect--dots {
  backdrop-filter: grayscale(0.6) contrast(1.04);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='7' height='7'%3E%3Ccircle cx='3.5' cy='3.5' r='1.5' fill='%23ffffff' fill-opacity='.55'/%3E%3C/svg%3E");
}

.effect--frost {
  background: rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(1px);
}

.effect--frost::after {
  content: "";
  position: absolute;
  right: 5px;
  bottom: 5px;
  width: 6px;
  height: 6px;
  background: var(--color-accent);
}

@supports not (backdrop-filter: blur(1px)) {
  .effect--blur,
  .effect--invert,
  .effect--dots,
  .effect--frost {
    background: rgba(255, 255, 255, 0.4);
  }
}
