/* ============================================================================
   GIOVANUKY — Sistema de diseño
   Paleta con raíz temática: dos "materiales" de Minecraft, ESMERALDA (verde)
   y REDSTONE (rojo), como los dos acentos que se alternan al azar en cada
   visita. Fondo negro fijo. Tipografía técnica/gaming, sin genéricos.
   ============================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Chakra+Petch:wght@400;500;600;700&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;600&display=swap');

:root {
  --bg: #08090a;
  --bg-elevated: #101214;
  --bg-card: #131619;
  --border: #23272b;
  --text: #eef1f0;
  --text-dim: #9aa3a0;
  --text-faint: #616a67;

  --font-display: 'Chakra Petch', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;

  --nav-h: 68px;
}

/* Tema esmeralda (verde claro) */
html.theme-esmeralda {
  --accent: #6be08a;
  --accent-strong: #3fd66d;
  --accent-soft: rgba(107, 224, 138, 0.12);
  --accent-glow: rgba(107, 224, 138, 0.35);
  --accent-text-on: #06120a;
  --theme-label: "Modo Esmeralda";
}

/* Tema redstone (rojo claro) */
html.theme-redstone {
  --accent: #ef6b6b;
  --accent-strong: #e8433f;
  --accent-soft: rgba(239, 107, 107, 0.12);
  --accent-glow: rgba(239, 107, 107, 0.35);
  --accent-text-on: #170606;
  --theme-label: "Modo Redstone";
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 12px); }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

.container { max-width: 1180px; margin: 0 auto; padding: 0 24px; }

h1, h2, h3 { font-family: var(--font-display); letter-spacing: 0.01em; margin: 0; }

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

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

/* Textura de fondo sutil tipo "bloques" — muy tenue, referencia a Minecraft sin copiar texturas */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 64px 64px;
  opacity: 0.06;
}

/* ---------------------------------------------------------------------- */
/* NAV                                                                     */
/* ---------------------------------------------------------------------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  background: rgba(8, 9, 10, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  justify-self: start;
}

.nav-brand .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent-glow); }

.nav-links {
  display: flex;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  display: inline-block;
  padding: 9px 16px;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-dim);
  transition: color 0.15s ease, background 0.15s ease;
}

.nav-links a:hover { color: var(--text); background: var(--bg-card); }
.nav-links a.active { color: var(--accent-text-on); background: var(--accent); }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  cursor: pointer;
  justify-self: end;
}

/* ---------------------------------------------------------------------- */
/* SECTION SHELL                                                          */
/* ---------------------------------------------------------------------- */
section { position: relative; z-index: 1; padding: 96px 0; }
section + section { border-top: 1px solid var(--border); }

.eyebrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
  width: 100%;
  text-align: center;
}
.eyebrow::before { content: ""; width: 18px; height: 2px; background: var(--accent); }

.section-title { font-size: clamp(1.8rem, 3.2vw, 2.6rem); font-weight: 700; margin-bottom: 14px; text-align: center; }
.section-lead { color: var(--text-dim); max-width: 640px; font-size: 1.02rem; margin: 0 auto 44px; text-align: center; }

/* ---------------------------------------------------------------------- */
/* HERO / SOBRE MÍ                                                        */
/* ---------------------------------------------------------------------- */
.hero { padding-top: 88px; }

.hero-grid {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 28px;
}

.avatar-wrap {
  position: relative;
  width: 220px;
  height: 220px;
}

.avatar-ring {
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, var(--accent), transparent 60%, var(--accent));
  animation: spin 12s linear infinite;
}

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

.avatar {
  position: relative;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  overflow: hidden;
  border: 4px solid var(--bg);
  background: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 3.2rem;
  font-weight: 700;
  color: var(--accent);
}

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

.hero-name { font-size: clamp(2.2rem, 5vw, 3.4rem); font-weight: 700; }
.hero-name .accent { color: var(--accent); }

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 4px 0 20px;
}

.pill {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-dim);
  background: var(--bg-card);
}
.pill strong { color: var(--text); font-weight: 600; }

.hero-desc { color: var(--text-dim); font-size: 1.03rem; max-width: 560px; margin: 0 auto; }

/* ---------------------------------------------------------------------- */
/* REDES SOCIALES                                                         */
/* ---------------------------------------------------------------------- */
.social-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
}

.social-card {
  flex: 0 1 220px;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  padding: 22px 16px;
  border: 2px solid rgba(var(--brand-rgb, 255,255,255), 0.55);
  border-radius: var(--radius-md);
  background: rgba(var(--brand-rgb, 255,255,255), 0.06);
  transition: border-color 0.18s ease, transform 0.18s ease, background 0.18s ease;
}

.social-card:hover, .social-card:focus-visible {
  border-color: var(--brand, var(--accent));
  transform: translateY(-2px);
  background: rgba(var(--brand-rgb, 255,255,255), 0.16);
}

/* TikTok: la marca usa dos colores (cian + rojo/rosa), así que en vez de un
   solo --brand se pinta un borde degradado real con las dos tonalidades. */
.social-card.brand-gradiente {
  border: 2px solid transparent;
  background:
    linear-gradient(var(--bg-card), var(--bg-card)) padding-box,
    linear-gradient(135deg, var(--brand-2), var(--brand)) border-box;
}
.social-card.brand-gradiente:hover {
  background:
    linear-gradient(rgba(var(--brand-rgb),0.14), rgba(var(--brand-rgb),0.14)) padding-box,
    linear-gradient(135deg, var(--brand-2), var(--brand)) border-box;
  transform: translateY(-2px);
}

.social-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brand, var(--text)); /* usado por fill="currentColor" en los iconos monocromos */
  flex-shrink: 0;
}
.social-icon svg { width: 30px; height: 30px; }

.social-name { font-weight: 600; font-size: 0.98rem; }
.social-sub { font-size: 0.8rem; color: var(--text-faint); font-family: var(--font-mono); }

.social-preview {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  transform: translateX(-50%) translateY(6px);
  width: 320px;
  background: var(--bg-elevated);
  border: 1px solid var(--brand, var(--accent));
  border-radius: var(--radius-md);
  padding: 14px;
  box-shadow: 0 18px 40px rgba(0,0,0,0.55);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 20;
  text-align: left;
  max-height: 70vh;
  overflow-y: auto;
}

.social-card:hover .social-preview,
.social-card:focus-visible .social-preview {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.social-preview-row-full { flex-direction: column; align-items: flex-start; gap: 2px; }
.social-preview-row-full b { white-space: normal; line-height: 1.3; }

/* Contenedores de widgets/iframes oficiales embebidos en el preview */
.preview-embed { border-radius: 8px; overflow: hidden; min-height: 40px; }
.preview-embed iframe { width: 100%; border: 0; display: block; }
.preview-embed[data-embed="twitch"] iframe,
.preview-embed[data-embed="kick"] iframe { aspect-ratio: 16/9; }
.preview-embed-discord iframe { height: 300px; }

.social-preview-title { font-family: var(--font-display); font-weight: 700; font-size: 0.92rem; margin-bottom: 10px; }
.social-preview-row { display: flex; justify-content: space-between; font-size: 0.8rem; padding: 4px 0; border-top: 1px dashed var(--border); color: var(--text-dim); }
.social-preview-row:first-of-type { border-top: none; }
.social-preview-row b { color: var(--text); font-family: var(--font-mono); }

/* ---------------------------------------------------------------------- */
/* CONTENIDO / PLAYLISTS HORIZONTALES                                     */
/* ---------------------------------------------------------------------- */
.content-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 30px; }

.content-tab {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-dim);
  cursor: pointer;
  background: transparent;
}
.content-tab.active { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

.playlist-block { margin-bottom: 46px; }
.playlist-block:last-child { margin-bottom: 0; }

.playlist-heading {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 4px;
  margin-bottom: 14px;
}
.playlist-heading h3 { font-size: 1.1rem; }
.playlist-heading span { font-size: 0.78rem; color: var(--text-faint); font-family: var(--font-mono); }

.playlist-row {
  display: flex;
  justify-content: safe center; /* centra cuando caben pocos videos, pero
    nunca recorta el inicio del scroll cuando hay más de los que caben
    (a diferencia de "center" a secas, que sí puede cortar contenido) */
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 12px;
  scroll-snap-type: x proximity;
}
.playlist-row::-webkit-scrollbar { height: 6px; }
.playlist-row::-webkit-scrollbar-thumb { background: var(--border); border-radius: 999px; }

.video-card {
  scroll-snap-align: start;
  flex: 0 0 260px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-card);
  cursor: pointer;
}

.video-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--bg-elevated);
  overflow: hidden;
}
.video-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.25s ease; }
.video-card:hover .video-thumb img { transform: scale(1.05); }

.video-thumb .play {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
}
.video-thumb .play svg {
  width: 46px; height: 46px;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,0.5));
}
.video-thumb .play circle { fill: rgba(0,0,0,0.5); }
.video-thumb .play path { fill: var(--accent); }

.video-thumb iframe { width: 100%; height: 100%; border: 0; }

.video-info { padding: 12px 14px; }
.video-title { font-size: 0.86rem; font-weight: 600; line-height: 1.35; margin-bottom: 6px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.video-stats { font-size: 0.72rem; color: var(--text-faint); font-family: var(--font-mono); }

.state-msg {
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  padding: 22px;
  color: var(--text-dim);
  font-size: 0.9rem;
}
.state-msg code { color: var(--accent); font-family: var(--font-mono); }

/* ---------------------------------------------------------------------- */
/* COLABORACIONES                                                         */
/* ---------------------------------------------------------------------- */
.collab-group { margin-bottom: 48px; }
.collab-group:last-child { margin-bottom: 0; }
.collab-group-title {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text);
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  text-align: center;
}

.collab-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 180px));
  gap: 14px;
  justify-content: center;
}

.collab-cierre {
  text-align: center;
  margin-top: 44px;
  padding-top: 32px;
  border-top: 1px dashed var(--border);
  color: var(--text-dim);
  font-size: 1rem;
}
.collab-cierre a {
  color: var(--accent);
  font-weight: 600;
  font-family: var(--font-mono);
  text-decoration: underline;
  text-underline-offset: 3px;
  position: relative;
}

.collab-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 20px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  color: var(--text); /* los <button> (logos con video) no heredan color por defecto como <div>/<a> */
  text-align: center;
  transition: border-color 0.18s ease, transform 0.18s ease;
  cursor: pointer;
  font: inherit; /* por si es un <button>, que no se vea distinto al resto */
}
.collab-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.collab-card.activo { border-color: var(--accent); background: var(--accent-soft); }

.collab-logo {
  width: 72px; height: 72px;
  border-radius: 16px;
  background: var(--bg-elevated);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--accent);
}
/* Los logos reales ya vienen limpios (PNG transparente) -> sin caja de color
   forzada encima, solo se agranda un poco (105%) para que el "aire" propio
   del PNG no se sienta como si hubiera doble margen. */
.collab-logo.has-image { background: transparent; }
.collab-logo img { width: 105%; height: 105%; object-fit: contain; }

/* Panel de video embebido: se abre DENTRO de la página al hacer clic en el
   logo de un servidor, en vez de navegar o abrir una ventana emergente. */
.collab-video-panel {
  margin-top: 20px;
  border: 1px solid var(--accent);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-card);
  animation: toast-in 0.2s ease;
}
.collab-video-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  border-bottom: 1px solid var(--border);
}
.collab-video-header button {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-dim);
  border-radius: 999px;
  width: 28px;
  height: 28px;
  cursor: pointer;
  font-size: 0.85rem;
  line-height: 1;
}
.collab-video-header button:hover { color: var(--text); border-color: var(--accent); }
.collab-video-frame { aspect-ratio: 16/9; background: #000; }
.collab-video-frame iframe { width: 100%; height: 100%; border: 0; display: block; }

.collab-name { font-size: 0.85rem; font-weight: 600; }

/* ---------------------------------------------------------------------- */
/* FOOTER                                                                  */
/* ---------------------------------------------------------------------- */
footer {
  padding: 40px 0 60px;
  text-align: center;
  color: var(--text-faint);
  font-size: 0.85rem;
}
footer a { color: var(--accent); position: relative; }
footer .theme-badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono); font-size: 0.72rem;
  margin-top: 10px; color: var(--text-faint);
}
footer .theme-badge .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }

/* Aviso flotante "Correo copiado ✓" (respaldo cuando mailto: no abre nada) */
.toast-copiado {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translateX(-50%);
  background: var(--accent);
  color: var(--accent-text-on);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 999px;
  white-space: nowrap;
  max-width: 90vw;
  text-overflow: ellipsis;
  overflow: hidden;
  box-shadow: 0 8px 20px rgba(0,0,0,0.4);
  z-index: 30;
  animation: toast-in 0.15s ease;
}
@keyframes toast-in {
  from { opacity: 0; transform: translateX(-50%) translateY(4px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ---------------------------------------------------------------------- */
/* RESPONSIVE                                                              */
/* ---------------------------------------------------------------------- */
@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; text-align: center; }
  .avatar-wrap { margin: 0 auto; }
  .hero-meta, .hero-desc { justify-content: center; margin-left: auto; margin-right: auto; }
  .nav-links {
    position: fixed;
    top: var(--nav-h);
    left: 0; right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 10px 16px 16px;
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-toggle { display: block; }
  section { padding: 64px 0; }
}
