@font-face {
  font-family: "Brinnan";
  src: url("../assets/fonts/Brinnan-Regular.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Brinnan";
  src: url("../assets/fonts/Brinnan-Bold.otf") format("opentype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg-a: #2e93a7;
  --bg-b: #0f7186;
  --bg-c: #163d55;
  --bg-image: none;
  --accent: #f3c24f;
  --card: #050607;
  --glass-bg: rgba(4, 8, 12, 0.58);
  --glass-border: rgba(255, 255, 255, 0.18);
  --glass-highlight: rgba(255, 255, 255, 0.12);
  --text: #ffffff;
  --muted: rgba(255, 255, 255, 0.72);
  --card-radius: 8px;
  --shadow: 0 18px 55px rgba(0, 0, 0, 0.24);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  color-scheme: dark;
  background: #0a1628;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  font-family: "Brinnan", "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", Arial, sans-serif;
  background:
    radial-gradient(circle at 18% 8%, rgba(255, 255, 255, 0.2), transparent 24rem),
    linear-gradient(145deg, var(--bg-a), var(--bg-b) 48%, var(--bg-c));
  overflow-x: hidden;
}

body[data-background-mode="particles"] {
  background: transparent;
}

body[data-background-mode="animated-mesh"] {
  background:
    radial-gradient(circle at 12% 8%, rgba(129, 236, 231, 0.44), transparent 18rem),
    radial-gradient(circle at 86% 18%, rgba(255, 255, 255, 0.22), transparent 16rem),
    radial-gradient(circle at 22% 88%, rgba(7, 35, 61, 0.42), transparent 22rem),
    radial-gradient(circle at 82% 78%, rgba(243, 194, 79, 0.18), transparent 18rem),
    linear-gradient(135deg, var(--bg-a), var(--bg-b) 48%, var(--bg-c));
  background-size: 135% 135%, 150% 150%, 145% 145%, 160% 160%, 100% 100%;
  animation: ambientBase 20s ease-in-out infinite alternate;
}

body::before {
  position: fixed;
  inset: -24%;
  z-index: -2;
  content: "";
  background:
    radial-gradient(circle at 12% 18%, rgba(117, 230, 225, 0.34), transparent 18rem),
    radial-gradient(circle at 82% 14%, rgba(255, 255, 255, 0.18), transparent 15rem),
    radial-gradient(circle at 24% 82%, rgba(2, 30, 47, 0.34), transparent 22rem),
    radial-gradient(circle at 78% 82%, rgba(243, 194, 79, 0.18), transparent 17rem),
    conic-gradient(from 190deg at 50% 48%, rgba(255, 255, 255, 0.08), rgba(4, 119, 140, 0.1), rgba(12, 65, 89, 0.24), rgba(255, 255, 255, 0.08));
  filter: blur(8px);
  transform: translate3d(0, 0, 0);
}

body::after {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.028) 1px, transparent 1px),
    var(--bg-image);
  background-position: center;
  background-size: 46px 46px, 46px 46px, cover;
  opacity: 0.34;
}

body[data-background-mode="animated"]::before {
  animation: backgroundDrift 16s ease-in-out infinite alternate;
}

body[data-background-mode="animated-mesh"]::before {
  animation: meshDrift 18s ease-in-out infinite alternate;
}

body[data-background-mode="animated-mesh"]::after {
  animation: gridFloat 22s linear infinite;
}

body[data-background-mode="particles"]::before,
body[data-background-mode="particles"]::after {
  display: none;
}

body.has-bg-image::after {
  opacity: 0.55;
}

a {
  color: inherit;
}

.bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(circle at 18% 8%, rgba(90, 184, 240, 0.22), transparent 20rem),
    radial-gradient(circle at 82% 16%, rgba(139, 110, 232, 0.18), transparent 18rem),
    linear-gradient(#0d1d38, #0a1628);
}

body:not([data-background-mode="particles"]) .bg {
  display: none;
}

.bg i {
  position: absolute;
  left: var(--x);
  bottom: -10px;
  width: var(--s);
  height: var(--s);
  border-radius: 50%;
  background: var(--c);
  box-shadow: 0 0 6px 2px var(--c);
  opacity: 0.6;
  animation:
    particleFloat var(--d) linear infinite var(--t),
    particleSway 6s ease-in-out infinite alternate var(--t);
}

.social-shell {
  position: relative;
  z-index: 1;
  width: min(100%, 440px);
  min-height: 100vh;
  margin: 0 auto;
  padding: max(28px, env(safe-area-inset-top)) 14px max(34px, env(safe-area-inset-bottom));
}

.social-shell--fallback {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 12px;
  text-align: center;
}

.loading,
.load-error {
  margin: 24px 0;
  color: var(--muted);
  text-align: center;
}

.profile {
  display: grid;
  justify-items: center;
  padding: 8px 8px 26px;
  text-align: center;
}

.profile-logo {
  width: clamp(86px, 26vw, 124px);
  aspect-ratio: 1;
  object-fit: contain;
  filter: drop-shadow(0 14px 28px rgba(0, 0, 0, 0.22));
}

.profile h1 {
  max-width: 100%;
  margin: 12px 0 4px;
  font-size: clamp(1.85rem, 9vw, 2.35rem);
  line-height: 0.95;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.profile-claim {
  margin: 0;
  color: rgba(255, 255, 255, 0.92);
  font-size: clamp(1.02rem, 4.8vw, 1.22rem);
  font-weight: 700;
  line-height: 1.15;
}

.social-icons {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 18px;
}

.social-icon {
  display: grid;
  width: 35px;
  height: 35px;
  place-items: center;
  color: #fff;
  font-size: 1.72rem;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  transition: transform 160ms ease, color 160ms ease;
}

.social-icon:hover,
.social-icon:focus-visible {
  color: var(--accent);
  transform: translateY(-2px);
}

.content-section {
  margin-top: 16px;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 28px 0 14px;
  font-size: clamp(1.02rem, 4.8vw, 1.18rem);
  line-height: 1.2;
  text-align: center;
}

.section-title__icon {
  color: var(--accent);
  font-size: 0.78em;
}

.card-list,
.card-grid {
  display: grid;
  gap: 10px;
}

.card-grid {
  grid-template-columns: repeat(var(--columns, 1), minmax(0, 1fr));
}

.link-card,
.preview-card {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 66px;
  color: #fff;
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--card-radius);
  box-shadow: var(--shadow);
  text-decoration: none;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

body[data-glass="on"] .link-card,
body[data-glass="on"] .preview-card {
  background:
    linear-gradient(135deg, var(--glass-highlight), transparent 42%),
    var(--glass-bg);
  border-color: var(--glass-border);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 18px 48px rgba(0, 0, 0, 0.26);
  backdrop-filter: blur(18px) saturate(1.28);
  -webkit-backdrop-filter: blur(18px) saturate(1.28);
}

.link-card:hover,
.link-card:focus-visible,
.preview-card:hover,
.preview-card:focus-visible {
  border-color: rgba(255, 255, 255, 0.28);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.16), transparent 44%),
    rgba(7, 13, 18, 0.68);
  transform: translateY(-2px);
  outline: none;
}

.link-card {
  gap: 12px;
  min-height: 58px;
  padding: 9px 34px 9px 10px;
}

.link-card__image {
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
}

.link-card__image--contain {
  object-fit: contain;
  padding: 5px;
}

.link-card__body {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  gap: 3px;
  justify-items: start;
  text-align: left;
}

.link-card__title {
  max-width: 100%;
  font-size: clamp(0.98rem, 4vw, 1.06rem);
  font-weight: 700;
  line-height: 1.05;
  overflow-wrap: anywhere;
}

.link-card__subtitle {
  max-width: 100%;
  color: rgba(255, 255, 255, 0.66);
  font-size: 0.88rem;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.menu-dots {
  position: absolute;
  top: 50%;
  right: 10px;
  color: rgba(255, 255, 255, 0.42);
  font-size: 1rem;
  line-height: 1;
  transform: translateY(-50%);
}

.preview-card {
  display: grid;
  min-height: 0;
  padding: 8px;
}

.preview-card__media {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.12);
}

.preview-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 1;
}

.preview-card__image--contain {
  object-fit: contain;
}

.preview-card__label {
  display: block;
  width: 100%;
  padding: 16px 34px 10px;
  font-size: clamp(1rem, 4.8vw, 1.14rem);
  font-weight: 700;
  line-height: 1.1;
  text-align: center;
}

.preview-card .menu-dots {
  top: auto;
  right: 13px;
  bottom: 10px;
  transform: none;
}

.link-card--grid {
  min-height: 58px;
}

.link-card--center {
  justify-content: center;
  padding: 14px 18px;
}

@media (min-width: 520px) {
  .social-shell {
    padding-inline: 18px;
  }

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

  .content-section[data-layout="grid"] .link-card {
    min-height: 108px;
    align-content: center;
    justify-content: center;
    padding: 16px 28px 14px;
    text-align: center;
  }

  .content-section[data-layout="grid"] .link-card__image {
    width: 54px;
    height: 54px;
  }

  .content-section[data-layout="grid"] .link-card__body {
    justify-items: center;
    text-align: center;
  }
}

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

@keyframes backgroundDrift {
  0% {
    transform: translate3d(-1.5%, -1%, 0) scale(1);
  }

  100% {
    transform: translate3d(1.5%, 1%, 0) scale(1.04);
  }
}

@keyframes meshDrift {
  0% {
    transform: translate3d(-2.5%, -1.5%, 0) rotate(-1deg) scale(1.02);
  }

  45% {
    transform: translate3d(1.5%, 1%, 0) rotate(1.2deg) scale(1.06);
  }

  100% {
    transform: translate3d(2.5%, -0.5%, 0) rotate(-0.6deg) scale(1.04);
  }
}

@keyframes gridFloat {
  0% {
    background-position: center, center, center;
  }

  100% {
    background-position: 46px 46px, 46px 46px, center;
  }
}

@keyframes ambientBase {
  0% {
    background-position: 0% 0%, 100% 8%, 0% 100%, 100% 90%, center;
  }

  50% {
    background-position: 18% 12%, 80% 0%, 12% 82%, 88% 100%, center;
  }

  100% {
    background-position: 30% 4%, 66% 18%, 2% 72%, 72% 82%, center;
  }
}

@keyframes particleFloat {
  to {
    transform: translateY(-110vh);
  }
}

@keyframes particleSway {
  from {
    margin-left: -14px;
  }

  to {
    margin-left: 14px;
  }
}
