/* =========================================================================
   Dreex · enlaces
   Oscuro, una sola columna, acento cian. Sin dependencias.
   ========================================================================= */

:root {
  --bg: #0a0d12;
  --s1: #10161e;          /* tarjetas */
  --s2: #161d27;          /* hover / huecos de imagen */
  --line: #1d2633;
  --line-2: #2a3546;

  --text: #e8eef5;
  --text-2: #a4b0c0;
  --text-3: #75839a;

  --accent: #3cc6ff;
  --accent-2: #8b7bff;

  --r: 14px;
  --r-sm: 10px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --fast: 180ms;

  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Space Grotesk", var(--font);

  --col: 580px;
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

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

body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background-color: var(--bg);
  /* Dos halos muy suaves: cian arriba, violeta abajo */
  background-image:
    radial-gradient(60rem 28rem at 50% -8rem, rgba(60, 198, 255, 0.13), transparent 70%),
    radial-gradient(50rem 30rem at 50% 115%, rgba(139, 123, 255, 0.09), transparent 70%);
  background-repeat: no-repeat;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Cuadrícula fina que se desvanece hacia abajo */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(140, 190, 240, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(140, 190, 240, 0.045) 1px, transparent 1px);
  background-size: 36px 36px;
  background-position: center top;
  -webkit-mask-image: radial-gradient(ellipse 70% 55% at 50% 0%, #000 15%, transparent 80%);
  mask-image: radial-gradient(ellipse 70% 55% at 50% 0%, #000 15%, transparent 80%);
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

.i {
  width: 1em;
  height: 1em;
  flex-shrink: 0;
  fill: currentColor;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

.skip {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 10;
  padding: 10px 14px;
  border-radius: var(--r-sm);
  background: var(--accent);
  color: #04131c;
  font-weight: 600;
}
.skip:focus { top: 16px; }

/* ---------- Columna ---------- */
.page {
  width: 100%;
  max-width: var(--col);
  margin: 0 auto;
  padding: 56px 16px 0;
}

/* ---------- Perfil ---------- */
.profile {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 36px;
}

.avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  padding: 3px;
  background: linear-gradient(140deg, var(--accent), var(--accent-2));
  box-shadow: 0 10px 40px -12px rgba(60, 198, 255, 0.55);
  margin-bottom: 16px;
}

.name {
  font-family: var(--display);
  font-size: 30px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.handle {
  margin-top: 4px;
  color: var(--accent);
  font-family: var(--display);
  font-weight: 500;
  font-size: 15px;
}

.bio {
  margin-top: 10px;
  max-width: 38ch;
  color: var(--text-2);
  font-size: 15px;
}

/* ---------- Etiquetas de sección ---------- */
.group + .group,
.favorites { margin-top: 32px; }

.label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 4px 12px;
  font-family: var(--display);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-2);
}
.label .i { color: var(--accent); font-size: 15px; }

.sublabel {
  margin: 20px 4px 10px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-3);
}

/* ---------- Tarjetas de enlace ---------- */
.links {
  display: grid;
  gap: 10px;
}

.link {
  --brand: var(--accent);
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 64px;
  padding: 10px 16px 10px 10px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--s1);
  transition:
    transform var(--fast) var(--ease),
    border-color var(--fast) var(--ease),
    background-color var(--fast) var(--ease),
    box-shadow var(--fast) var(--ease);
}

.link-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: var(--r-sm);
  font-size: 24px;
  color: var(--ink, #fff);
  background: var(--brand);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12), 0 6px 16px -8px var(--brand);
  transition: transform var(--fast) var(--ease), box-shadow var(--fast) var(--ease);
}

/* Iconos reales de la web: ocupan todo el cuadrado */
.link-icon.is-art { overflow: hidden; }
.link-icon.is-art > .i { width: 100%; height: 100%; }
.link-icon.is-art > img { width: 100%; height: 100%; object-fit: cover; }
.link-icon.is-art > img.pad { padding: 5px; object-fit: contain; }  /* logos que llegan al borde */

.link-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}
.link-text strong {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.3;
}
.link-text span {
  color: var(--text-3);
  font-size: 13.5px;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.link-arrow {
  font-size: 18px;
  color: var(--text-3);
  transition: color var(--fast) var(--ease), transform var(--fast) var(--ease);
}

@media (hover: hover) {
  .link:hover {
    transform: translateY(-1px);
    background: var(--s2);
    border-color: color-mix(in srgb, var(--brand) 45%, var(--line));
    box-shadow: 0 12px 30px -18px color-mix(in srgb, var(--brand) 60%, transparent);
  }
  .link:hover .link-icon { transform: scale(1.06); }
  .link:hover .link-arrow { color: var(--brand); transform: translate(2px, -2px); }
}
.link:active { transform: translateY(0); background: var(--s2); }

/* ---------- Favoritos ---------- */
.favorites {
  padding-top: 32px;
  border-top: 1px solid var(--line);
}
.favorites .sublabel:first-child { margin-top: 0; }
.fav-group + .fav-group { margin-top: 22px; }

.covers {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.cover a { display: block; border-radius: var(--r-sm); }

.cover-frame {
  position: relative;
  display: block;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: var(--s2);
}
.cover-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 300ms var(--ease), opacity 300ms var(--ease);
}

/* Sin imagen (aún no ha llegado o ha fallado): inicial del título */
.cover-frame:not(:has(img))::after,
.cover-frame.is-broken::after {
  content: attr(data-initial);
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--display);
  font-size: 34px;
  font-weight: 700;
  color: var(--line-2);
}
.cover-frame.is-broken img { opacity: 0; }

.cover-title {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  margin-top: 8px;
  font-size: 13px;
  line-height: 1.35;
  color: var(--text-2);
  transition: color var(--fast) var(--ease);
}

@media (hover: hover) {
  .cover a:hover .cover-frame img { transform: scale(1.03); }
  .cover a:hover .cover-title { color: var(--text); }
}

/* Esqueleto mientras cargan los animes */
.cover.is-loading .cover-frame,
.cover.is-loading .cover-title {
  background: linear-gradient(100deg, var(--s1) 30%, var(--s2) 50%, var(--s1) 70%) 0 0 / 300% 100%;
  animation: shimmer 1.4s linear infinite;
}
.cover.is-loading .cover-title { border-radius: 4px; width: 70%; }
@keyframes shimmer { to { background-position: -150% 0; } }

/* Aviso si no se pueden cargar los animes */
.notice {
  grid-column: 1 / -1;
  padding: 14px 16px;
  border: 1px dashed var(--line-2);
  border-radius: var(--r-sm);
  color: var(--text-3);
  font-size: 13.5px;
}
.notice a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------- Pie ---------- */
.footer {
  max-width: var(--col);
  margin: 0 auto;
  padding: 40px 16px 48px;
  text-align: center;
  color: var(--text-3);
  font-size: 13px;
}
.footer-legal {
  margin-top: 4px;
  font-size: 12px;
  opacity: 0.8;
}

/* ---------- Móvil ---------- */
@media (max-width: 480px) {
  .page { padding-top: 40px; }
  .avatar { width: 88px; height: 88px; }
  .name { font-size: 27px; }
  .link { min-height: 60px; gap: 12px; padding-right: 14px; }
  .link-icon { width: 40px; height: 40px; font-size: 22px; }
  .link-text strong { font-size: 15.5px; }
  .link-text span { font-size: 13px; }
  .covers { gap: 10px; }
  .cover-title { font-size: 12px; }
}

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