/* ============================================
   BUBBLES.CSS — Globos de texto CSS :target
                 Estilo retro-tech, paleta
                 del vision board
   ============================================ */

/* ─── OVERLAY — oculto por defecto ─── */
.bubble-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  pointer-events: none;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.bubble-overlay:target {
  pointer-events: all;
  visibility: visible;
  opacity: 1;
}

/* Glow rojo en el backdrop al abrirse */
.bubble-overlay:target .bubble-backdrop {
  animation: backdropGlow 0.5s ease forwards;
}

@keyframes backdropGlow {
  0%   { background: rgba(131, 26, 49, 0.25); }
  40%  { background: rgba(131, 26, 49, 0.18); }
  100% { background: rgba(20, 16, 16, 0.78); }
}

/* ─── FONDO OSCURO ─── */
.bubble-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 16, 16, 0.78);
  cursor: pointer;
  font-size: 0;
}

/* ─── CAJA DEL GLOBO ─── */
.bubble-box {
  position: relative;
  z-index: 1;
  width: min(700px, 100%);
  max-height: 84vh;
  background: var(--black-deep);
  border: 1px solid var(--border-dim);
  /* Línea de acento roja arriba — indicador de sistema activo */
  border-top: 2px solid var(--red);
  overflow: hidden;
  display: flex;
  flex-direction: column;

  /* Estado inicial */
  transform: scale(0.06) translateY(120px);
  transform-origin: center bottom;
  opacity: 0;
  transition:
    transform 0.42s cubic-bezier(0.34, 1.52, 0.64, 1),
    opacity   0.32s ease;
}

.bubble-overlay:target .bubble-box {
  transform: scale(1) translateY(0);
  opacity: 1;
  animation: bubblePop 0.42s cubic-bezier(0.34, 1.52, 0.64, 1) both;
}

/* Cola del globo */
.bubble-box::before {
  content: '';
  position: absolute;
  bottom: -13px;
  left: 50%;
  transform: translateX(-50%);
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-top: 13px solid var(--border-dim);
}

.bubble-box::after {
  content: '';
  position: absolute;
  bottom: -11px;
  left: 50%;
  transform: translateX(-50%);
  border-left: 9px solid transparent;
  border-right: 9px solid transparent;
  border-top: 11px solid var(--black-deep);
}

/* ─── HEADER DEL GLOBO ─── */
.bubble-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px 13px;
  border-bottom: 1px solid var(--border-dim);
  flex-shrink: 0;
  background: var(--surface);
  gap: 12px;
}

/* Indicadores estilo OS retro (círculos de estado) */
.bubble-header::before {
  content: '● ● ●';
  font-size: 0.45rem;
  letter-spacing: 0.3em;
  color: var(--red);
  opacity: 0.6;
  flex-shrink: 0;
}

/* Título — Now Black */
.bubble-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1rem;
  color: var(--white);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  flex: 1;
  text-align: center;
}

/* Botón cerrar */
.bubble-close {
  text-decoration: none;
  border: 1px solid var(--border-dim);
  color: var(--blue);
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  flex-shrink: 0;
  opacity: 0.7;
  transition: opacity 0.2s, background 0.2s, border-color 0.2s;
}

.bubble-close:hover {
  opacity: 1;
  background: rgba(131, 26, 49, 0.25);
  border-color: var(--red);
  color: var(--white);
}

/* ─── CUERPO CON SCROLL ─── */
.bubble-body {
  overflow-y: auto;
  padding: 26px 26px 44px;
  flex: 1;
  scrollbar-width: thin;
  scrollbar-color: var(--red) var(--black-deep);
}

.bubble-body::-webkit-scrollbar       { width: 3px; }
.bubble-body::-webkit-scrollbar-track { background: var(--black-deep); }
.bubble-body::-webkit-scrollbar-thumb { background: var(--red); }

/* ─── CONTENIDO CV ─── */

/* Bio */
.cv-bio {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(0.82rem, 1.8vw, 0.95rem);
  line-height: 1.75;
  color: rgba(223, 223, 223, 0.72);
  margin-bottom: 30px;
  padding: 14px 16px;
  border-left: 2px solid var(--red);
  background: var(--glass);
}

/* Secciones */
.cv-section { margin-bottom: 28px; }

/* Título de sección — Now Black + Silkscreen para el número */
.cv-section-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 0.78rem;
  color: var(--white);
  text-transform: uppercase;
  letter-spacing: 0.25em;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Número de sección en Silkscreen */
.cv-section-title .section-num {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--red);
  opacity: 0.8;
}

/* Línea después del título */
.cv-section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, var(--border), transparent);
}

/* Item de CV */
.cv-item {
  margin-bottom: 10px;
  padding: 11px 14px;
  background: rgba(57, 49, 49, 0.35);
  border-left: 2px solid var(--red);
  transition: background 0.2s;
}

.cv-item:hover {
  background: rgba(57, 49, 49, 0.6);
}

/* Nombre del lugar — Now Black pequeño */
.cv-item-place {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--white);
  margin-bottom: 3px;
}

/* Período — Silkscreen */
.cv-item-period {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  color: var(--red);
  margin-bottom: 4px;
  letter-spacing: 0.08em;
}

/* Descripción — Now Medium */
.cv-item-desc {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 0.82rem;
  color: var(--blue);
  line-height: 1.5;
}

/* ─── BARRAS DE HABILIDADES ─── */
.skill-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 9px;
}

/* Nombre — Now Medium */
.skill-name {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--white);
  min-width: 128px;
}

.skill-track {
  flex: 1;
  height: 2px;
  background: rgba(156, 160, 171, 0.15);
  position: relative;
  overflow: hidden;
}

/* Puntos de escala — estética retro */
.skill-track::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    90deg,
    rgba(156, 160, 171, 0.2) 0px,
    rgba(156, 160, 171, 0.2) 1px,
    transparent 1px,
    transparent 10%
  );
}

.skill-fill {
  position: absolute;
  top: 0; left: 0;
  height: 100%;
  width: 0;
  background: var(--red);
  transition: none;
}

/* Animar barras cuando el CV está activo */
#cv:target .skill-fill {
  animation: skillGrow 0.9s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  animation-delay: 0.45s;
}

/* Porcentaje — Silkscreen */
.skill-pct {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  color: var(--red);
  min-width: 32px;
  text-align: right;
}

/* ─── TAGS ─── */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 0.6rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 4px 10px;
  border: 1px solid var(--border);
  color: var(--blue);
  background: rgba(131, 26, 49, 0.08);
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.tag:hover {
  background: rgba(131, 26, 49, 0.2);
  color: var(--white);
  border-color: var(--red);
}

/* ─── CONTACTO ─── */
.contact-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 12px;
}

.contact-link {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--red);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  letter-spacing: 0.05em;
  opacity: 0.85;
  transition: opacity 0.2s, color 0.2s;
}

.contact-link::before {
  content: '▶';
  font-size: 0.45rem;
  color: var(--red);
}

.contact-link:hover {
  opacity: 1;
  color: var(--white);
}

/* Botones tipo consola (usados en CV y Portafolio) */
.console-btn {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-decoration: none;
  color: var(--white);
  background: rgba(0, 0, 0, 0.24);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  padding: 10px 16px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  transition: transform 0.14s ease, background 0.2s, border-color 0.2s;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.console-btn::before {
  content: '>';
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.85rem;
}

.console-btn:hover {
  background: rgba(255, 255, 255, 0.10);
  border-color: rgba(255, 255, 255, 0.30);
  transform: translateY(-1px);
}

.console-btn:hover .console-cmd {
  color: var(--white);
}

.console-btn:hover .console-cursor {
  opacity: 1;
}

.console-btn:active {
  background: rgba(131, 26, 49, 0.25);
  transform: translateY(0);
}

.console-btn + .console-btn {
  border-top: 1px solid var(--border-dim);
}

.console-prompt {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.65);
}

.console-cmd {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.85);
}

.console-cursor {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.55);
  opacity: 0;
  transition: opacity 0.2s ease;
}

/* Sub-globos (Logofolio, Brand, Ilustra, Stickers) */
.bubble-overlay--sub {
  z-index: 110;
}

/* Navegación dentro del globo del portafolio */
.portfolio-nav {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 18px;
}

.portfolio-nav .console-btn {
  width: 100%;
  justify-content: flex-start;
  padding: 10px 16px;
}

/* Galería dentro de cada sub-globo */
.sub-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  padding: 16px;
}

.sub-gallery-item {
  background: rgba(0, 0, 0, 0.20);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.sub-gallery-img {
  width: 100%;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 0 18px rgba(0, 0, 0, 0.35);
}

.sub-gallery-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--white);
  opacity: 0.85;
}

/* ─── PORTAFOLIO ─── */
.portfolio-shell {
  padding: 20px 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  align-items: center;
  text-align: center;
}

.portfolio-cuadro {
  display: flex;
  justify-content: center;
  width: 100%;
}

.portfolio-cuadro a {
  display: inline-block;
}

.portfolio-hero {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
}

.portfolio-hero-img {
  width: 100%;
  height: auto;
  display: block;
  filter: drop-shadow(0 0 16px rgba(0, 0, 0, 0.35));
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Make the portfolio SVG match the CV SVG sizing for consistency */
.portfolio-cuadro-img {
  width: min(340px, 90%);
  height: auto;
  display: block;
  filter: drop-shadow(0 0 16px rgba(0, 0, 0, 0.35));
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ─── PORTAFOLIO: GRID DE SECCIONES ─── */
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  width: 100%;
  margin-top: 18px;
}

.portfolio-card {
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.portfolio-card-img {
  width: 100%;
  height: auto;
  border-radius: 10px;
  box-shadow: 0 0 12px rgba(0, 0, 0, 0.35);
}

.portfolio-card-label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--white);
}

/* Ajustes específicos para el globo del portafolio */
.bubble-box--portfolio {
  width: min(820px, 100%);
}

.bubble-body--portfolio {
  padding: 18px 18px 22px;
}

.portfolio-tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 8px;
}

.portfolio-tab-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.portfolio-tab {
  padding: 8px 14px;
  font-size: 0.70rem;
  letter-spacing: 0.1em;
  border-radius: 999px;
}

/* Highlights the active tab */
#tab-logofolio:checked + label[for="tab-logofolio"],
#tab-branding:checked + label[for="tab-branding"],
#tab-ilustraciones:checked + label[for="tab-ilustraciones"],
#tab-stikers:checked + label[for="tab-stikers"] {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.34);
  color: var(--white);
}

.portfolio-panels {
  width: 100%;
  max-width: 520px;
  margin-top: 16px;
}

.portfolio-panel {
  display: none;
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.24);
}

/* Show panel when corresponding tab is selected */
#tab-logofolio:checked ~ .portfolio-panels #panel-logofolio,
#tab-branding:checked ~ .portfolio-panels #panel-branding,
#tab-ilustraciones:checked ~ .portfolio-panels #panel-ilustraciones,
#tab-stikers:checked ~ .portfolio-panels #panel-stikers {
  display: block;
}

.portfolio-panel-note {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--blue);
  line-height: 1.8;
  opacity: 0.75;
}

.portfolio-panel-img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 12px;
  box-shadow: 0 0 16px rgba(0, 0, 0, 0.35);
}

/* ─── FOTO HEADER DEL CV ─── */
/*
   La imagen va sin fondo (PNG con transparencia).
   Se centra horizontalmente y tiene un tamaño máximo
   para no dominar el globo.
   mix-blend-mode: luminosity sutil para integrarla
   con el tema oscuro sin perder detalles.
*/
.cv-photo-wrap {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  margin: -4px 0 20px;       /* sube un poco para tocar el header */
  pointer-events: none;
  user-select: none;
}

.cv-photo {
  width: min(340px, 90%);    /* responsive: nunca más ancho que el globo */
  height: auto;
  display: block;
  /* Sin fondo — el PNG con transparencia se integra directo */
  /* Sutil tinte para que case con la paleta oscura */
  filter: drop-shadow(0 0 18px rgba(131, 26, 49, 0.25));
  transition: filter 0.3s ease;
}

..cv-photo:hover {
  filter: drop-shadow(0 0 24px rgba(131, 26, 49, 0.45));
}

/* ─── PORTAFOLIO CUADRO SVG ─── */
.portfolio-cuadro-img {
  width: min(340px, 90%);
  height: auto;
  display: block;
}

/* ─── RESPONSIVE ─── */
@media (max-width: 500px) {
  .bubble-body  { padding: 18px 16px 36px; }
  .skill-name   { min-width: 90px; }
  .bubble-title { font-size: 0.82rem; }
  .cv-photo     { width: min(280px, 95%); }
  .portfolio-cuadro-img { width: min(280px, 95%); }
}
