:root {
  --page: #f8f2ff;
  --violet: #c084fc;
  --violet-soft: #d8b4fe;
  --lilac: #e9d5ff;
  --lilac-pale: #f5f3ff;
  --tint: #f3e8ff;
  --text: #6b21a8;
  --text-title: #4c1d95;
  --text-soft: #7e22ce;
  --accent: #7c3aed;
  --accent-strong: #9333ea;
  --line: rgba(192, 132, 252, 0.45);
  --line-soft: rgba(192, 132, 252, 0.3);
  --glass: rgba(255, 255, 255, 0.78);
  --glass-card: rgba(255, 255, 255, 0.94);
  --glass-widget: rgba(255, 255, 255, 0.88);
  --font-pixel: "Press Start 2P", "DotGothic16", monospace;
  --font-vt: "VT323", "DotGothic16", monospace;
  --font-body: "Nunito", "DotGothic16", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }

body {
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  font-family: var(--font-body);
  color: var(--text);
  background-color: var(--page);
  background-image: var(--bg-image, linear-gradient(160deg, #f3e8ff 0%, #e0e7ff 52%, #f0d9ff 100%));
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: rgba(248, 242, 255, 0.45);
}

::selection { background: var(--violet); color: #fff; }
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #fbf7ff; }
::-webkit-scrollbar-thumb { background: linear-gradient(var(--violet), #a855f7); border-radius: 4px; }

a { color: var(--accent); font-weight: 700; text-decoration: none; }
a:hover { color: var(--accent-strong); text-decoration: underline; text-underline-offset: 3px; }
a:focus-visible, .skip:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
strong { color: var(--accent-strong); font-weight: 700; }
code { padding: 0 4px; font-size: 0.88em; background: var(--tint); border-radius: 3px; }

.skip { position: absolute; left: 8px; top: -48px; z-index: 50; padding: 8px 14px; background: #fff; }
.skip:focus { top: 8px; }

/* Estrellitas flotantes */
.stars { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.stars span {
  position: absolute;
  left: var(--x);
  top: var(--y);
  font-size: var(--s);
  color: var(--violet);
  opacity: 0;
  animation: twinkle var(--d) ease-in-out infinite var(--w);
}
.stars span:nth-child(3n) { color: #fff; }
.stars span:nth-child(3n+1) { color: var(--accent-strong); }
@keyframes twinkle {
  0%, 100% { opacity: 0; transform: scale(0.5) rotate(0deg); }
  50% { opacity: 0.75; transform: scale(1.2) rotate(15deg); }
}

/* Cinta superior */
.marquee {
  position: relative;
  z-index: 10;
  overflow: hidden;
  white-space: nowrap;
  padding: 6px 0;
  font-family: var(--font-pixel);
  font-size: 0.55rem;
  letter-spacing: 0.06em;
  color: var(--text);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.95);
  background: linear-gradient(90deg, #fff, var(--tint), var(--lilac), #fff);
  background-size: 300% 100%;
  border-bottom: 2px solid rgba(192, 132, 252, 0.4);
  animation: slide-bg 5s linear infinite;
}
.marquee span { display: inline-block; animation: scroll-x 60s linear infinite; }
@keyframes scroll-x { to { transform: translateX(-50%); } }
@keyframes slide-bg { to { background-position: 300% 50%; } }

/* Estructura */
.page { position: relative; z-index: 1; display: flex; justify-content: center; padding: 20px 12px 40px; }
.site { width: 100%; max-width: 1100px; }

/* Banner */
.banner {
  position: relative;
  min-height: 210px;
  background: linear-gradient(135deg, #ede1ff, #dbe4ff 55%, #f3dcff) center 30% / cover;
  border: 3px solid var(--violet);
  border-bottom: 0;
  outline: 2px solid var(--lilac);
  outline-offset: 1px;
  border-radius: 6px 6px 0 0;
}
.banner__tab { position: absolute; left: -3px; bottom: -3px; z-index: 5; }
.banner__name {
  display: inline-block;
  padding: 8px 20px;
  font-family: var(--font-pixel);
  font-weight: 400;
  font-size: clamp(1rem, 4vw, 1.4rem);
  letter-spacing: 0.05em;
  color: var(--accent);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  border: 2px dashed var(--violet-soft);
  border-bottom: 0;
  border-radius: 10px 10px 0 0;
}
.banner__name small { margin-left: 6px; font-family: var(--font-body); font-size: 0.5em; font-weight: 700; letter-spacing: 0; color: var(--text-soft); }

/* Espacios de imagen (carpeta gifs/) */
.slot-empty {
  display: grid;
  place-content: center;
  gap: 4px;
  width: 100%;
  height: 100%;
  min-height: inherit;
  padding: 10px;
  text-align: center;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-soft);
}
.slot-empty code { font-family: var(--font-vt); font-size: 1rem; font-weight: 400; }
.has-gif > .slot-empty { display: none; }
.slot-media img, .slot-media video { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center 25%; }
.banner.has-gif { background-size: cover; }

/* Contenedor vidrio */
.layout {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr) 175px;
  gap: 12px;
  width: 100%;
  padding: 14px;
  background: var(--glass);
  border: 2px dashed var(--violet-soft);
  border-radius: 0 0 4px 4px;
  box-shadow: 0 0 0 2px rgba(192, 132, 252, 0.15), 0 4px 30px rgba(124, 58, 237, 0.08), inset 0 0 30px rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(6px);
}
.side, .main { display: flex; flex-direction: column; min-width: 0; }
.side { gap: 10px; }
.main { gap: 14px; }

/* Widgets de las columnas */
.widget {
  overflow: hidden;
  background: var(--glass-widget);
  border: 2px solid var(--lilac);
  border-radius: 4px;
  box-shadow: 0 2px 10px rgba(233, 213, 255, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.8);
}
.widget__title {
  padding: 7px 10px;
  font-family: var(--font-pixel);
  font-weight: 400;
  font-size: 0.55rem;
  line-height: 1.5;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-title);
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
  background: linear-gradient(90deg, var(--tint), var(--violet-soft), var(--tint));
  background-size: 200% 100%;
  animation: slide-bg 4s linear infinite;
}
.widget__title--center { text-align: center; }
.widget__img {
  position: relative;
  height: 144px;
  overflow: hidden;
  border-bottom: 1px solid var(--line-soft);
  background: linear-gradient(135deg, var(--tint), var(--lilac-pale));
}
.widget__img--tall { height: 200px; }
.widget__img--photo { background: var(--tint); }
.widget__img--photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.widget__body { padding: 10px; font-size: 0.85rem; line-height: 1.6; }
.widget__body p + p { margin-top: 6px; }
.note { font-size: 0.8rem; color: var(--text-soft); }

.profile-name { margin-bottom: 8px; font-family: var(--font-vt); font-size: 1.5rem; line-height: 1.1; color: var(--accent); text-shadow: 0 1px 0 rgba(255, 255, 255, 0.95); }
.info { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
.info tr + tr td { border-top: 1px dashed var(--line); }
.info td { padding: 4px; vertical-align: top; }
.info__key { padding-right: 8px; font-family: var(--font-vt); font-size: 1.05rem; line-height: 1.2; white-space: nowrap; color: var(--accent-strong); }

/* Etiquetas */
.tags { display: flex; flex-wrap: wrap; justify-content: center; gap: 5px; }
.tag {
  padding: 2px 9px;
  font-size: 0.75rem;
  color: var(--text);
  background: rgba(233, 213, 255, 0.2);
  border: 1px solid var(--lilac);
  border-radius: 10px;
}
.stack .tags { justify-content: flex-start; }

/* Tarjetas de contenido */
.card {
  overflow: hidden;
  background: var(--glass-card);
  border: 2px solid var(--line);
  border-radius: 5px;
  box-shadow: 0 2px 14px rgba(124, 58, 237, 0.08);
  transition: border-color 0.25s, box-shadow 0.25s;
}
.card:hover { border-color: var(--violet); box-shadow: 0 3px 20px rgba(192, 132, 252, 0.2); }
.card__head {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 8px 14px;
  background: linear-gradient(90deg, var(--tint), var(--lilac-pale));
  border-bottom: 1px solid var(--line-soft);
}
.card__date { font-family: var(--font-vt); font-size: 1.05rem; letter-spacing: 0.05em; color: var(--text); }
.card__title { font-family: var(--font-pixel); font-weight: 400; font-size: 0.65rem; line-height: 1.6; letter-spacing: 0.04em; color: var(--accent-strong); text-shadow: 1px 1px 0 #fff; }
.card__body { display: flex; flex-direction: column; gap: 10px; padding: 14px; font-size: 0.95rem; line-height: 1.75; }
.card__foot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px 14px; border-top: 1px dashed var(--line-soft); }
.tag--post { font-size: 0.75rem; color: var(--accent); background: rgba(124, 58, 237, 0.08); border-color: rgba(192, 132, 252, 0.15); }
.card__more { margin-left: auto; font-size: 0.8rem; }

/* Imagen grande de la introducción */
.media { position: relative; margin-top: 4px; overflow: hidden; border-radius: 4px; background: linear-gradient(135deg, var(--tint), var(--lilac-pale)); }
.media--auto:not(.has-gif) { min-height: 240px; border: 2px dashed var(--violet-soft); }
.media--auto .slot-media img, .media--auto .slot-media video { height: auto; }


/* Experiencia */
.mini-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 8px; }
.mini { padding: 8px 10px; background: var(--glass-card); border: 1px dashed var(--line); line-height: 1.3; }
.mini::before { content: "> "; font-family: var(--font-vt); font-weight: 700; font-size: 1.1rem; color: var(--violet); }
.mini__name { font-family: var(--font-vt); font-size: 1.25rem; font-weight: 700; color: var(--accent-strong); }
.mini__cat { display: block; margin-top: 2px; font-size: 0.78rem; color: var(--text-soft); }
.mini__text { margin-top: 6px; font-size: 0.88rem; line-height: 1.55; }

/* Stack */
.stack { gap: 14px; }
.stack__group { display: flex; flex-direction: column; gap: 6px; }
.stack__label { padding: 2px 0; font-family: var(--font-pixel); font-size: 0.5rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-soft); border-bottom: 1px dashed var(--line); }

/* Proyectos */
.projects { display: flex; flex-direction: column; list-style: none; }
.projects li { padding: 6px; font-size: 0.9rem; line-height: 1.45; border-radius: 3px; }
.projects li:hover { background: rgba(124, 58, 237, 0.08); }
.projects a { font-weight: 700; color: var(--accent-strong); }

/* Redes y ahora */
.social-list { display: flex; flex-direction: column; }
.social-link { display: flex; flex-direction: column; padding: 6px 4px; font-size: 0.8rem; line-height: 1.3; border-bottom: 1px dashed var(--line); }
.social-link:last-child { border-bottom: 0; }
.social-link strong { color: var(--text-title); }
.social-link span { color: var(--accent); font-weight: 700; overflow-wrap: anywhere; }
.now { list-style: none; }
.now li { position: relative; padding: 5px 0 5px 18px; font-size: 0.82rem; line-height: 1.45; border-top: 1px dashed var(--line); }
.now li:first-child { border-top: 0; }
.now li::before { content: "♡"; position: absolute; left: 0; top: 4px; color: var(--accent-strong); }

/* Botón 88x31 */
.btn88 {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 88px;
  height: 31px;
  margin-top: 10px;
  font-family: var(--font-pixel);
  font-size: 0.4rem;
  color: var(--text-title);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.95);
  background: linear-gradient(135deg, var(--tint), var(--lilac-pale));
  border: 1px solid var(--violet);
  border-radius: 1px;
}
.btn88:hover { text-decoration: none; filter: brightness(1.08); }

/* Pie */
.foot {
  margin-top: 12px;
  padding: 12px;
  text-align: center;
  background: linear-gradient(90deg, var(--glass), var(--lilac-pale), var(--glass));
  border: 2px dashed var(--violet-soft);
  border-top-width: 3px;
  border-radius: 0 0 6px 6px;
}
.foot__title { font-family: var(--font-pixel); font-size: 0.5rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); }
.foot__text { margin-top: 8px; font-family: var(--font-vt); font-size: 1.1rem; color: var(--text); }

@media (max-width: 768px) {
  .layout { grid-template-columns: 1fr; }
  .side--right { order: 3; }
  .main { order: 2; }
  .side:not(.side--right) { order: 1; }
  .widget__img--tall { height: 160px; }
}
@media (max-width: 600px) {
  .site { max-width: 99%; }
  .banner { min-height: 150px; }
}

@media (prefers-reduced-motion: reduce) {
  .marquee, .marquee span, .widget__title { animation: none; }
  .marquee { overflow-x: auto; }
  .stars span { animation: none; opacity: 0.5; }
}
