/* =====================================================================
   LINKS PAGE — dedicated stylesheet (loaded only on /en/links/ and /sr/links/)
   Uses the shared tokens from styles.css (--bg, --text, --muted, --red ...).
   ===================================================================== */

/* <----- 01. PAGE BASE AND ANIMATED BACKDROP -----> */
.links-page {
  position: relative;
  display: flex;
  min-height: 100svh;
  flex-direction: column;
  overflow-x: hidden;
}

.links-bg {
  position: fixed;
  z-index: -1;
  inset: 0;
  overflow: hidden;
  background: radial-gradient(120% 80% at 50% 0%, #1b0508 0%, var(--bg) 62%);
  pointer-events: none;
}

.links-bg__blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.5;
  will-change: transform;
}

.links-bg__blob--one {
  top: -14vmax;
  left: -14vmax;
  width: 46vmax;
  height: 46vmax;
  background: radial-gradient(circle, #e50920 0, transparent 68%);
  animation: links-drift-a 22s ease-in-out infinite alternate;
}

.links-bg__blob--two {
  right: -14vmax;
  bottom: -16vmax;
  width: 42vmax;
  height: 42vmax;
  background: radial-gradient(circle, #7a0412 0, transparent 68%);
  animation: links-drift-b 27s ease-in-out infinite alternate;
}

/* Film grain: a tiny inline SVG noise tile, no extra file to upload. */
.links-bg__grain {
  position: absolute;
  inset: 0;
  opacity: 0.08;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

.links-bg::after {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 45%, rgb(0 0 0 / 55%) 100%);
  content: "";
}

@keyframes links-drift-a {
  to { transform: translate(14vmax, 10vmax) scale(1.15); }
}

@keyframes links-drift-b {
  to { transform: translate(-12vmax, -9vmax) scale(1.2); }
}

/* <----- 02. TOP BAR: logo and language switch -----> */
.links-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px max(22px, var(--page-gutter));
}

.links-top__logo {
  display: block;
  width: 52px;
  line-height: 0;
  transition: transform 300ms cubic-bezier(0.2, 0.8, 0.2, 1), filter 300ms ease;
}

.links-top__logo img {
  width: 100%;
  height: auto;
}

.links-top__logo:hover,
.links-top__logo:focus-visible {
  filter: drop-shadow(0 0 14px rgb(229 9 32 / 65%));
  transform: rotate(-6deg) scale(1.06);
}

.links-lang {
  display: flex;
  align-items: center;
  gap: 6px;
}

.links-lang__link {
  display: inline-flex;
  min-width: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 999px;
  color: #d7d2ce;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  transition: color 180ms ease, border-color 180ms ease;
}

.links-lang__link:hover {
  color: var(--red);
}

.links-lang__link[aria-current="page"] {
  border-color: rgb(229 9 32 / 60%);
  color: var(--red);
}

/* <----- 03. HEADING BLOCK -----> */
.links-main {
  width: min(820px, calc(100% - 44px));
  flex: 1;
  margin-inline: auto;
  padding: clamp(18px, 5vw, 48px) 0 56px;
}

.links-eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.links-eyebrow span {
  display: inline-block;
  width: 28px;
  height: 1px;
  background: var(--red);
}

.links-title {
  margin: 18px 0 0;
  font-family: var(--font-display);
  font-size: clamp(48px, 10vw, 92px);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.03em;
}

.links-title em {
  display: inline-block;
  color: var(--red);
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 500;
  letter-spacing: -0.035em;
  animation: links-flicker 7s infinite;
}

/* Neon flicker: mostly steady, with a brief stutter every few seconds. */
@keyframes links-flicker {
  0%, 90%, 100% { opacity: 1; text-shadow: 0 0 24px rgb(229 9 32 / 55%); }
  91% { opacity: 0.55; text-shadow: none; }
  92% { opacity: 1; text-shadow: 0 0 38px rgb(229 9 32 / 95%); }
  94% { opacity: 0.7; text-shadow: none; }
  95% { opacity: 1; text-shadow: 0 0 30px rgb(229 9 32 / 80%); }
}

/* A red line that draws itself, with a glowing tip that rides the end. */
.links-rule {
  position: relative;
  display: block;
  width: 0;
  max-width: 220px;
  height: 2px;
  margin: 22px 0 0;
  background: linear-gradient(90deg, transparent, var(--red));
  animation: links-draw 1.1s 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.links-rule::after {
  position: absolute;
  top: 50%;
  right: -3px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ff3347;
  box-shadow: 0 0 14px 4px rgb(229 9 32 / 80%);
  content: "";
  transform: translateY(-50%);
}

@keyframes links-draw {
  to { width: 220px; }
}

.links-intro {
  max-width: 46ch;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.8;
}

/* <----- 04. STAGGERED ENTRANCE: each block fades in, un-blurs and rises -----> */
.links-reveal {
  opacity: 0;
  animation: links-in 800ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
  animation-delay: calc(var(--i, 0) * 90ms + 120ms);
}

@keyframes links-in {
  from { opacity: 0; filter: blur(8px); transform: translateY(26px) scale(0.97); }
  to { opacity: 1; filter: blur(0); transform: none; }
}

/* <----- 05. LINK CARDS -----> */
.link-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  margin: 38px 0 0;
  padding: 0;
  list-style: none;
}

.link-list__item {
  min-width: 0;
}

.link-card {
  position: relative;
  display: flex;
  min-height: 92px;
  align-items: center;
  gap: 18px;
  padding: 18px 20px;
  overflow: hidden;
  border: 1px solid rgb(255 255 255 / 9%);
  border-radius: 18px;
  background: linear-gradient(180deg, rgb(255 255 255 / 5%), rgb(255 255 255 / 1.5%));
  backdrop-filter: blur(10px);
  isolation: isolate;
  transition: transform 350ms cubic-bezier(0.2, 0.8, 0.2, 1), border-color 300ms ease, box-shadow 350ms ease;
}

/* Cursor spotlight: --mx/--my are set by links.js while the pointer moves. */
.link-card::before {
  position: absolute;
  z-index: -1;
  inset: 0;
  background: radial-gradient(280px circle at var(--mx, 50%) var(--my, 50%), rgb(229 9 32 / 24%), transparent 62%);
  content: "";
  opacity: 0;
  transition: opacity 300ms ease;
}

/* Light sweep that crosses the card on hover. */
.link-card::after {
  position: absolute;
  z-index: -1;
  top: 0;
  bottom: 0;
  left: -60%;
  width: 40%;
  background: linear-gradient(100deg, transparent, rgb(255 255 255 / 14%), transparent);
  content: "";
  transform: skewX(-18deg);
  transition: transform 800ms ease;
}

.link-card:hover,
.link-card:focus-visible {
  border-color: rgb(229 9 32 / 65%);
  box-shadow: 0 18px 40px -18px rgb(229 9 32 / 60%), inset 0 0 0 1px rgb(229 9 32 / 20%);
  transform: translateY(-4px);
}

.link-card:hover::before,
.link-card:focus-visible::before {
  opacity: 1;
}

.link-card:hover::after,
.link-card:focus-visible::after {
  transform: skewX(-18deg) translateX(420%);
}

.link-card:active {
  transform: translateY(-1px) scale(0.99);
}

/* Logo medallion with a ring that spins up on hover. */
.link-card__mark {
  position: relative;
  display: grid;
  width: 56px;
  height: 56px;
  flex: 0 0 56px;
  place-items: center;
}

.link-card__mark::before {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, transparent 0 50%, var(--red));
  content: "";
  opacity: 0;
  transition: opacity 300ms ease;
  animation: links-spin 1.6s linear infinite;
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 2px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 2px));
}

.link-card:hover .link-card__mark::before,
.link-card:focus-visible .link-card__mark::before {
  opacity: 1;
}

@keyframes links-spin {
  to { transform: rotate(360deg); }
}

.link-card__face {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgb(255 255 255 / 14%);
  border-radius: 50%;
  background: #0d0d0d;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 22px;
}

.link-card__face img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Uploaded brand logos (the "logo" setting) keep their shape inside the circle. */
.link-card__mark--logo .link-card__face img {
  padding: 11px;
  object-fit: contain;
}

.link-card__face svg {
  width: 26px;
  height: 26px;
}

/* No icon and no working logo: show the first letter instead (class added by PHP or links.js). */
.link-card__mark.no-logo .link-card__face img {
  display: none;
}

.link-card__mark.no-logo .link-card__face::after {
  content: attr(data-initial);
}

.link-card__body {
  display: grid;
  min-width: 0;
  flex: 1;
  gap: 3px;
  justify-items: start;
}

.link-card__name {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: 0.03em;
  line-height: 1.2;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.link-card__note {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.link-card__arrow {
  display: grid;
  width: 42px;
  height: 42px;
  flex: none;
  place-items: center;
  border: 1px solid rgb(255 255 255 / 14%);
  border-radius: 50%;
  color: var(--red);
  font-size: 18px;
  transition: transform 350ms cubic-bezier(0.2, 0.8, 0.2, 1), background-color 250ms ease, color 250ms ease, border-color 250ms ease;
}

.link-card:hover .link-card__arrow,
.link-card:focus-visible .link-card__arrow {
  border-color: var(--red);
  background: var(--red);
  color: #ffffff;
  transform: translate(3px, -3px) rotate(8deg);
}

/* <----- 06. PRIMARY CARD (FetLife): bigger, rotating red border and a heartbeat glow -----> */
@property --links-angle {
  syntax: "<angle>";
  initial-value: 0deg;
  inherits: false;
}

.link-card--primary {
  min-height: 124px;
  padding: 24px 26px;
  border: 2px solid transparent;
  background:
    linear-gradient(#140809, #0c0707) padding-box,
    conic-gradient(from var(--links-angle), #e50920, #3a0309 25%, #e50920 50%, #3a0309 75%, #e50920) border-box;
  animation: links-border 6s linear infinite, links-heartbeat 2.8s ease-in-out infinite;
}

.link-card--primary .link-card__mark {
  width: 68px;
  height: 68px;
  flex-basis: 68px;
}

.link-card--primary .link-card__name {
  font-size: 30px;
}

.link-card--primary .link-card__note {
  font-size: 14px;
}

@keyframes links-border {
  to { --links-angle: 360deg; }
}

@keyframes links-heartbeat {
  0%, 100% { box-shadow: 0 0 0 0 rgb(229 9 32 / 0%), 0 14px 44px -24px rgb(229 9 32 / 55%); }
  14% { box-shadow: 0 0 0 7px rgb(229 9 32 / 18%), 0 14px 54px -16px rgb(229 9 32 / 75%); }
  28% { box-shadow: 0 0 0 0 rgb(229 9 32 / 0%), 0 14px 44px -24px rgb(229 9 32 / 55%); }
  42% { box-shadow: 0 0 0 5px rgb(229 9 32 / 12%), 0 14px 50px -20px rgb(229 9 32 / 65%); }
}

.link-card__badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 4px;
  padding: 4px 11px 4px 9px;
  border-radius: 999px;
  background: var(--red);
  color: #ffffff;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.link-card__badge::before {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ffffff;
  content: "";
  animation: links-blink 1.4s ease-in-out infinite;
}

@keyframes links-blink {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.25; transform: scale(0.7); }
}

/* <----- 07. BACK LINK, PAGE FOOTER AND HELPERS -----> */
.links-back {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: 10px;
  margin-top: 34px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: color 180ms ease, gap 250ms ease;
}

.links-back:hover,
.links-back:focus-visible {
  gap: 16px;
  color: var(--red);
}

.links-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 24px;
  padding: 22px max(22px, var(--page-gutter));
  border-top: 1px solid rgb(255 255 255 / 6%);
  color: var(--muted);
  font-size: 11px;
}

.links-foot a {
  color: var(--text);
  transition: color 180ms ease;
}

.links-foot a:hover,
.links-foot a:focus-visible {
  color: var(--red);
}

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

/* <----- 08. DESKTOP: two columns, FetLife spans the full width -----> */
@media (min-width: 720px) {
  .link-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .link-list__item--primary {
    grid-column: 1 / -1;
  }
}

/* <----- 09. PHONES -----> */
@media (max-width: 520px) {
  .link-card {
    gap: 14px;
    padding: 16px;
  }

  .link-card__mark {
    width: 48px;
    height: 48px;
    flex-basis: 48px;
  }

  .link-card--primary {
    padding: 20px 18px;
  }

  .link-card--primary .link-card__mark {
    width: 56px;
    height: 56px;
    flex-basis: 56px;
  }

  .link-card__name {
    font-size: 19px;
  }

  .link-card--primary .link-card__name {
    font-size: 25px;
  }

  .link-card__arrow {
    width: 36px;
    height: 36px;
    font-size: 16px;
  }
}

/* <----- 10. ACCESSIBILITY: no motion when the visitor asks for less -----> */
@media (prefers-reduced-motion: reduce) {
  .links-bg__blob,
  .links-title em,
  .link-card--primary,
  .link-card__badge::before,
  .link-card__mark::before {
    animation: none;
  }

  .links-reveal {
    opacity: 1;
    animation: none;
  }

  .links-rule {
    width: 220px;
    animation: none;
  }

  .link-card,
  .link-card::after,
  .link-card__arrow,
  .links-top__logo {
    transition-duration: 0.01ms;
  }

  .link-card:hover,
  .link-card:focus-visible {
    transform: none;
  }
}