:root {
  color-scheme: light dark;

  --font-body: "DM Sans", system-ui, sans-serif;
  --font-display: "Bricolage Grotesque", var(--font-body);

  --bg: #f1eae3;
  --bg-glow: rgba(169, 78, 46, 0.1);
  --text: #241c18;
  --muted: #6d5d53;
  --card: #ffffff;
  --card-border: #c9b8a9;
  --card-shadow: 0 2px 6px rgba(36, 28, 24, 0.1);
  --card-shadow-hover: 0 6px 18px rgba(36, 28, 24, 0.12);
  --button-bg: rgba(238, 226, 210, 0.7);
  --button-hover: rgba(231, 216, 196, 0.85);
  --button-border: #cdb99f;
  --button-border-hover: #ac8b65;
  --accent: #a94e2e;
  --ring: var(--accent);

  --radius-card: 0.9rem;
  --container: 30rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14100e;
    --bg-glow: rgba(223, 155, 115, 0.09);
    --text: #f4ede8;
    --muted: #b7a79d;
    --card: #272019;
    --card-border: #57493f;
    --card-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
    --card-shadow-hover: 0 6px 18px rgba(0, 0, 0, 0.55);
    --button-bg: rgba(59, 48, 36, 0.7);
    --button-hover: rgba(71, 57, 43, 0.85);
    --button-border: #66523e;
    --button-border-hover: #967753;
    --accent: #df9b73;
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  isolation: isolate;
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  justify-content: center;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.5;
  color: var(--text);
  background:
    radial-gradient(55rem 28rem at 50% -10rem, var(--bg-glow), transparent 70%),
    var(--bg);
}

h1,
h2 {
  font-family: var(--font-display);
}

::selection {
  background: var(--accent);
  color: var(--bg);
}

.background-loves {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.background-loves span {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: var(--size);
  aspect-ratio: 1;
  opacity: var(--opacity);
  transform: translate(
    calc(var(--parallax-x, 0px) * var(--depth)),
    calc(var(--parallax-y, 0px) * var(--depth))
  );
  transition: transform 0.8s ease-out;
}

.background-loves span::before {
  content: "";
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--accent), transparent 95%);
  -webkit-mask: url("assets/love.svg") center / contain no-repeat;
  mask: url("assets/love.svg") center / contain no-repeat;
  transform: rotate(var(--angle));
  animation: love-drift var(--duration) ease-in-out infinite;
  animation-delay: var(--delay);
}

.background-loves span:nth-child(1) {
  --x: calc(50% - 43rem);
  --y: -12%;
  --size: 30rem;
  --opacity: 0.12;
  --depth: 0.35;
  --angle: -25deg;
  --drift-x: 25px;
  --drift-y: 40px;
  --duration: 24s;
  --delay: -6s;
}

.background-loves span:nth-child(2) {
  --x: calc(50% + 17rem);
  --y: 54%;
  --size: 28rem;
  --opacity: 0.1;
  --depth: 0.25;
  --angle: 22deg;
  --drift-x: -35px;
  --drift-y: -45px;
  --duration: 28s;
  --delay: -14s;
}

.background-loves span:nth-child(3) {
  --x: calc(50% - 29rem);
  --y: 57%;
  --size: 10rem;
  --opacity: 0.16;
  --depth: 0.8;
  --angle: 18deg;
  --drift-x: -28px;
  --drift-y: -30px;
  --duration: 19s;
  --delay: -12s;
}

.background-loves span:nth-child(4) {
  --x: calc(50% + 20rem);
  --y: 13%;
  --size: 12rem;
  --opacity: 0.14;
  --depth: 0.65;
  --angle: -16deg;
  --drift-x: 30px;
  --drift-y: 28px;
  --duration: 21s;
  --delay: -5s;
}

.background-loves span:nth-child(5) {
  --x: calc(50% - 24rem);
  --y: 35%;
  --size: 3.5rem;
  --opacity: 0.22;
  --depth: 1.4;
  --angle: -12deg;
  --drift-x: 18px;
  --drift-y: -22px;
  --duration: 14s;
  --delay: -9s;
}

.background-loves span:nth-child(6) {
  --x: calc(50% + 18rem);
  --y: 79%;
  --size: 4.5rem;
  --opacity: 0.18;
  --depth: 1.15;
  --angle: 28deg;
  --drift-x: -20px;
  --drift-y: 24px;
  --duration: 17s;
  --delay: -2s;
}

@keyframes love-drift {
  0%,
  100% {
    transform: translate(0, 0) rotate(var(--angle)) scale(1);
  }
  50% {
    transform: translate(var(--drift-x), var(--drift-y))
      rotate(calc(var(--angle) + 12deg)) scale(1.05);
  }
}

@media (max-width: 60rem) {
  .background-loves span {
    width: calc(var(--size) * 0.55);
  }

  .background-loves span:nth-child(odd) {
    left: calc(var(--size) * -0.36);
  }

  .background-loves span:nth-child(even) {
    left: auto;
    right: calc(var(--size) * -0.36);
  }
}

.container {
  width: 100%;
  max-width: var(--container);
  padding: 3rem 1.25rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 2.25rem;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.profile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
  text-align: center;
}

.avatar {
  position: relative;
  width: 5rem;
  aspect-ratio: 3386 / 5029;
  background: url("assets/avatar.svg") center / contain no-repeat;
}

.bubble {
  position: absolute;
  top: -0.75rem;
  right: -1.75rem;
  padding: 0.2rem 0.6rem;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 0.6rem;
  box-shadow: var(--card-shadow);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text);
  white-space: nowrap;
  opacity: 0;
  transform: scale(0.85) translateY(4px);
  transform-origin: bottom right;
  transition:
    opacity 0.15s ease,
    transform 0.15s ease;
  pointer-events: none;
}

.bubble::after {
  content: "";
  position: absolute;
  right: 0.9rem;
  bottom: -0.3rem;
  width: 0.55rem;
  height: 0.55rem;
  background: var(--card);
  border-right: 1px solid var(--card-border);
  border-bottom: 1px solid var(--card-border);
  transform: rotate(45deg);
}

.avatar:hover .bubble {
  opacity: 1;
  transform: none;
  transition-delay: 0.25s;
}

.profile__name {
  margin: 0;
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.link-card,
.social-link {
  background: var(--button-bg);
  border: 1px solid var(--button-border);
  box-shadow: var(--card-shadow);
  color: var(--text);
  text-decoration: none;
  transition:
    transform 0.15s ease,
    background-color 0.15s ease,
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.link-card:hover,
.social-link:hover {
  transform: translateY(-2px);
  background-color: var(--button-hover);
  border-color: var(--button-border-hover);
  box-shadow: var(--card-shadow-hover);
}

.link-card:active,
.social-link:active {
  transform: translateY(0);
}

.link-card {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  width: 100%;
  padding: 0.95rem 1.15rem;
  border-radius: var(--radius-card);
  font-weight: 600;
}

.link-icon {
  flex: none;
  width: 1.5rem;
  font-size: 1.15rem;
  line-height: 1;
  text-align: center;
}

.link-label {
  min-width: 0;
  overflow-wrap: anywhere;
}

.social-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.9rem;
}

.socials {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
}

.social-link {
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
}

.social-icon {
  font-size: 1.25rem;
  line-height: 1;
}

a:focus-visible {
  outline: 3px solid var(--ring);
  outline-offset: 2px;
  border-radius: var(--radius-card);
}

.social-link:focus-visible {
  border-radius: 50%;
}

.footer {
  text-align: center;
  color: var(--muted);
  font-size: 0.8rem;
}

.footer p {
  margin: 0;
}

.love {
  display: inline-block;
  width: 0.95em;
  height: 0.82em;
  vertical-align: -0.08em;
  background-color: var(--accent);
  -webkit-mask: url("assets/love.svg") center / contain no-repeat;
  mask: url("assets/love.svg") center / contain no-repeat;
  transition: transform 0.15s ease;
}

@keyframes heartbeat {
  0%,
  28%,
  70%,
  100% {
    transform: scale(1);
  }
  14% {
    transform: scale(1.18);
  }
  42% {
    transform: scale(1.24);
  }
}

.love:hover {
  animation: heartbeat 1.1s ease-in-out infinite;
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.profile,
.social-section,
.footer {
  animation: fade-up 0.45s ease both;
}

.links li {
  animation: fade-up 0.45s ease both;
  animation-delay: calc(120ms + var(--i, 0) * 70ms);
}

.socials li {
  animation: fade-up 0.45s ease both;
  animation-delay: calc(320ms + var(--i, 0) * 60ms);
}

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

@media (min-width: 40rem) {
  .container {
    padding-top: 4.5rem;
  }

  .avatar {
    width: 6rem;
  }

  .profile__name {
    font-size: 1.9rem;
    line-height: 1.15;
  }
}
