/* ================================================================
   /links — Linktree-style bento page
   Mobile-first single column; bento grid at md+
   ================================================================ */

.links-page .site-main { padding-top: var(--space-8); padding-bottom: var(--space-16); }

.links-section {
  position: relative;
  isolation: isolate;
  min-height: calc(100svh - var(--nav-h));
  padding: var(--space-6) 0 var(--space-12);
}

/* Ambient background glow */
.links-section::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(60% 50% at 20% 10%, var(--glow), transparent 70%),
    radial-gradient(50% 40% at 90% 80%, var(--glow), transparent 70%);
  opacity: 0.6;
  pointer-events: none;
}

.links-container {
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
  padding: 0 var(--space-5);
}

/* ── Header ───────────────────────────────────────────────── */
.links-header {
  text-align: center;
  margin-bottom: var(--space-8);
}
.links-header__eyebrow {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: var(--space-2);
}

.links-header__intro {
  margin-top: var(--space-4);
  color: var(--text-secondary);
  font-size: var(--text-sm);
  max-width: 56ch;
  margin-left: auto;
  margin-right: auto;
}
.links-header__intro p { margin: 0 0 var(--space-2); }

@media (min-width: 768px) {
  .links-header { margin-bottom: var(--space-10); }
}

/* ── Bento grid ───────────────────────────────────────────── */
.links-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-3);
}

@media (min-width: 768px) {
  .links-grid {
    grid-template-columns: repeat(6, 1fr);
    grid-auto-rows: minmax(96px, auto);
    gap: var(--space-4);
  }
}

/* ── Tile base ────────────────────────────────────────────── */
.links-tile {
  --tx: 0deg;
  --ty: 0deg;
  --mx: 50%;
  --my: 50%;

  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  transition: transform 200ms ease, border-color 200ms ease, box-shadow 200ms ease;
  transform: perspective(800px) rotateY(var(--tx)) rotateX(var(--ty));
  will-change: transform;
}

.links-tile::after {
  /* Cursor-follow gradient highlight */
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(160px circle at var(--mx) var(--my), var(--glow-strong), transparent 60%);
  opacity: 0;
  transition: opacity 200ms ease;
  pointer-events: none;
}

.links-tile--link:hover {
  border-color: var(--border-bright);
  box-shadow: 0 12px 32px -16px rgba(0, 0, 0, 0.5), 0 0 0 1px var(--border-bright);
}
.links-tile--link:hover::after { opacity: 1; }

/* Hero and status tiles: static, no hover/tilt/gradient */
.links-tile--hero,
.links-tile--status {
  transform: none !important;
}
.links-tile--hero::after,
.links-tile--status::after { display: none; }

@media (prefers-reduced-motion: reduce) {
  .links-tile { transform: none !important; transition: border-color 200ms ease, box-shadow 200ms ease; }
  .links-tile::after { display: none; }
}

/* ── Hero tile ────────────────────────────────────────────── */
.links-tile--hero {
  display: grid;
  grid-template-columns: 88px 1fr;
  grid-template-areas: "photo identity";
  column-gap: var(--space-3);
  padding: var(--space-5) var(--space-4);
  align-items: center;
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface-raised) 100%);
}

.links-tile__hero-media {
  grid-area: photo;
  position: relative;
  width: 88px;
  height: 88px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.links-tile__avatar {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.links-tile__hero-media picture,
.links-tile__hero-media img { width: 100%; height: 100%; object-fit: cover; display: block; }

.links-tile__hero-glow {
  position: absolute;
  inset: -25%;
  background: radial-gradient(circle, var(--glow-strong), transparent 60%);
  filter: blur(20px);
  opacity: 0.6;
  z-index: -1;
}

.links-tile__hero-identity {
  grid-area: identity;
  min-width: 0;
  padding-top: 3px;
}

.links-tile__hero-name {
  font-family: var(--font-display);
  font-weight: var(--weight-bold);
  font-size: var(--text-xl);
  color: var(--text);
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin: 0;
}
.links-tile__hero-tagline {
  margin-top: var(--space-1);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.35;
}
.links-tile__hero-tagline--desktop { display: none; }
@media (min-width: 768px) {
  .links-tile__hero-tagline--mobile { display: none; }
  .links-tile__hero-tagline--desktop { display: inline; }
}

@media (min-width: 768px) {
  .links-tile--hero {
    grid-column: span 6;
    grid-template-columns: 80px 1fr;
    grid-template-areas: "photo identity";
    column-gap: var(--space-5);
    padding: var(--space-6);
    align-items: start;
  }
  .links-tile__hero-media { width: 80px; height: 80px; border-radius: 12px; align-self: start; }
  .links-tile__hero-identity { padding-top: 0; }
  .links-tile__hero-name { font-size: var(--text-3xl); }
  .links-tile__hero-tagline { font-size: var(--text-base); }
}

/* Status badge spacing in the links header */
.links-header .status-badge { margin-top: var(--space-3); }

/* ── Link tile ────────────────────────────────────────────── */
.links-tile--link { padding: 0; }

.links-tile__link {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  min-height: 64px;
  color: var(--text);
  text-decoration: none;
  height: 100%;
}
.links-tile__link:hover { text-decoration: none; color: var(--text); }
.links-tile__link:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
  border-radius: 16px;
}

.links-tile__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--surface-raised);
  color: var(--primary);
  flex-shrink: 0;
}
.links-tile__icon .fa-icon { width: 18px; height: 18px; }

.links-tile__body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.links-tile__label {
  font-family: var(--font-display);
  font-weight: var(--weight-semibold);
  font-size: var(--text-base);
  line-height: 1.2;
  color: var(--text);
}
.links-tile__desc {
  font-size: var(--text-xs);
  color: var(--text-muted);
  line-height: 1.3;
  font-family: var(--font-mono);
}

.links-tile__arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  color: var(--text-muted);
  transition: transform 200ms ease, color 200ms ease, background 200ms ease;
  flex-shrink: 0;
}
.links-tile--link:hover .links-tile__arrow {
  color: var(--primary);
  background: var(--glow);
  transform: translateX(2px);
}

/* Sizing variants on desktop */
@media (min-width: 768px) {
  .links-tile--link { grid-column: span 3; }
  .links-tile--sm   { grid-column: span 3; }
  .links-tile--md   { grid-column: span 3; }
  .links-tile--lg   { grid-column: span 6; }
}

/* ── Social row ───────────────────────────────────────────── */
.links-socials {
  list-style: none;
  margin: var(--space-8) 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-2);
}
.links-social {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  transition: color 200ms ease, border-color 200ms ease, background 200ms ease, transform 200ms ease;
}
.links-social:hover {
  color: var(--primary);
  border-color: var(--border-bright);
  background: var(--surface-raised);
  transform: translateY(-2px);
}
.links-social:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
.links-social__icon { display: inline-flex; }
.links-social .fa-icon { width: 18px; height: 18px; }

@media (prefers-reduced-motion: reduce) {
  .links-social:hover { transform: none; }
}

/* ── Footnote ─────────────────────────────────────────────── */
.links-footnote {
  margin-top: var(--space-8);
  text-align: center;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

/* Hide nav border on links page for a cleaner look — optional */
.links-page .site-main { padding-top: var(--space-4); }
