* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  background: #000;
  font-family: 'Segoe UI', system-ui, sans-serif;
  color: #e0e0e0;
  overflow: hidden;
  user-select: none;
}

canvas {
  display: block;
  cursor: grab;
}
canvas:active { cursor: grabbing; }

/* ── Header ── */
#header {
  position: fixed;
  top: 0; left: 0; right: 0;
  padding: 1.5rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 10;
  pointer-events: none;
}

#header h1 {
  font-size: 1.4rem;
  font-weight: 300;
  letter-spacing: 0.08em;
  color: #fff;
}

#header h1 span {
  color: #7eb8f7;
  font-weight: 600;
}

#skills {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.skill-badge {
  font-size: 0.72rem;
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid rgba(126, 184, 247, 0.4);
  color: #7eb8f7;
  background: rgba(126, 184, 247, 0.08);
  letter-spacing: 0.04em;
}

/* ── Título PORTAFOLIO ── */
#portfolio-title {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  margin-top: -12.5rem;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 0.55em;
  color: rgba(126, 184, 247, 0.75);
  text-transform: uppercase;
  pointer-events: none;
  z-index: 10;
  white-space: nowrap;
  text-shadow: 0 0 20px rgba(126, 184, 247, 0.3);
}

/* ── Controles del carrusel ── */
#carousel-controls {
  position: fixed;
  bottom: 2.8rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 1.2rem;
  z-index: 20;
}

#btn-prev,
#btn-next {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(126, 184, 247, 0.35);
  background: rgba(10, 10, 40, 0.7);
  color: #7eb8f7;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
  backdrop-filter: blur(6px);
}

#btn-prev:hover,
#btn-next:hover {
  background: rgba(126, 184, 247, 0.18);
  border-color: rgba(126, 184, 247, 0.7);
  transform: scale(1.1);
}

#btn-prev:active,
#btn-next:active {
  transform: scale(0.95);
}

#carousel-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
}

#carousel-label {
  font-size: 0.85rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.85);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  min-width: 140px;
  text-align: center;
  transition: opacity 0.3s;
}

/* ── Dots ── */
#carousel-dots {
  display: flex;
  gap: 0.45rem;
  align-items: center;
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: 1px solid rgba(126, 184, 247, 0.5);
  background: transparent;
  cursor: pointer;
  transition: background 0.25s, transform 0.25s, border-color 0.25s;
  padding: 0;
}

.dot.active {
  background: #7eb8f7;
  border-color: #7eb8f7;
  transform: scale(1.5);
}

/* ── Hint ── */
#hint {
  position: fixed;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.75);
  letter-spacing: 0.06em;
  animation: pulse 4s ease-in-out infinite;
  pointer-events: none;
  z-index: 10;
  white-space: nowrap;
  background: rgba(10, 10, 40, 0.6);
  border: 1px solid rgba(126, 184, 247, 0.2);
  border-radius: 20px;
  padding: 6px 16px;
  backdrop-filter: blur(6px);
}

@keyframes pulse {
  0%, 100% { opacity: 0.28; }
  50%       { opacity: 0.7; }
}

/* ── Modal ── */
#modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,5,0.8);
  backdrop-filter: blur(6px);
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

#modal-backdrop.open { display: flex; }

#modal {
  background: linear-gradient(135deg, rgba(10,10,30,0.98) 0%, rgba(5,5,20,0.98) 100%);
  border: 1px solid rgba(126, 184, 247, 0.25);
  border-radius: 16px;
  padding: 2.5rem;
  max-width: 480px;
  width: 100%;
  position: relative;
  animation: modalIn 0.25s ease;
  max-height: 90vh;
  overflow-y: auto;
}

@keyframes modalIn {
  from { transform: scale(0.92); opacity: 0; }
  to   { transform: scale(1);    opacity: 1; }
}

#modal-close {
  position: absolute;
  top: 1rem; right: 1.2rem;
  background: none;
  border: none;
  color: rgba(255,255,255,0.5);
  font-size: 1.4rem;
  cursor: pointer;
  line-height: 1;
  transition: color 0.2s;
  padding: 0.5rem;
}

#modal-close:hover { color: #fff; }

#modal-icon  { font-size: 2.5rem; margin-bottom: 1rem; }
#modal-title { font-size: 1.35rem; font-weight: 600; color: #fff; margin-bottom: 0.4rem; }
#modal-type  { font-size: 0.75rem; color: #7eb8f7; letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 1.1rem; }
#modal-desc  { font-size: 0.95rem; color: rgba(255,255,255,0.7); line-height: 1.7; margin-bottom: 1.5rem; }

#modal-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1.8rem;
}

.tag {
  font-size: 0.7rem;
  padding: 3px 9px;
  border-radius: 4px;
  background: rgba(126, 184, 247, 0.12);
  color: #a0c8f8;
  border: 1px solid rgba(126, 184, 247, 0.2);
}

#modal-links { display: flex; gap: 0.8rem; }

.btn {
  flex: 1;
  padding: 0.65rem 1rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}

.btn-primary            { background: #378add; color: #fff; }
.btn-primary:hover      { background: #4d98e8; }
.btn-outline            { background: transparent; color: #7eb8f7; border: 1px solid rgba(126, 184, 247, 0.4); }
.btn-outline:hover      { background: rgba(126, 184, 247, 0.1); }

/* ── Tooltip ── */
#tooltip {
  position: fixed;
  pointer-events: none;
  background: rgba(10,10,30,0.9);
  border: 1px solid rgba(126,184,247,0.3);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 0.78rem;
  color: #c8dcf6;
  display: none;
  z-index: 50;
  transition: opacity 0.15s;
}

/* ── Tablet (≤ 768px) ── */
@media (max-width: 768px) {
  #header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.7rem;
    padding: 1.2rem;
    background: linear-gradient(to bottom, rgba(0,0,0,0.6) 0%, transparent 100%);
  }
  #header h1    { font-size: 1.2rem; }
  .skill-badge  { font-size: 0.65rem; padding: 3px 8px; }
  #hint         { font-size: 0.65rem; }
  #modal        { padding: 2rem 1.5rem; }
}

/* ── Móvil (≤ 480px) ── */
@media (max-width: 480px) {
  #header       { padding: 1rem; gap: 0.5rem; }
  #header h1    { font-size: 1.05rem; }
  .skill-badge  { font-size: 0.6rem; padding: 3px 7px; }

  #btn-prev, #btn-next { width: 40px; height: 40px; font-size: 1rem; }
  #carousel-label      { font-size: 0.78rem; min-width: 110px; }

  #modal        { padding: 1.8rem 1.2rem 1.5rem; border-radius: 12px; max-height: 85vh; }
  #modal-icon   { font-size: 2rem; }
  #modal-title  { font-size: 1.15rem; }
  #modal-desc   { font-size: 0.88rem; }
  #modal-links  { flex-direction: column; }
  #tooltip      { display: none !important; }
}