:root {
  --background:     #0B1120;
  --card:           #172033;
  --text-primary:   #FFFFFF;
  --text-secondary: #CBD5E1;
  --primary:        #4F7CFF;
  --primary-hover:  #6B92FF;
  --secondary:      #93C5FD;
  --border:         #26334D;
  --radius:         24px;
  --radius-sm:      14px;
  --shadow:         0 1px 2px rgba(0,0,0,.25), 0 10px 34px rgba(0,0,0,.16);

  /* alias internos -> mapeados al nuevo sistema */
  --bg:          var(--background);
  --panel:       var(--card);
  --panel-alt:   #141d30;
  --panel-warm:  #161f31;
  --ink:         var(--text-primary);
  --muted:       var(--text-secondary);
  --line:        var(--border);
  --teal:        var(--primary);
  --teal-dim:    rgba(79, 124, 255, 0.12);
  --amber:       var(--secondary);
  --amber-dim:   rgba(147, 197, 253, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
}

body {
  overflow: hidden;
  color: var(--text-primary);
  background: linear-gradient(180deg, #0B1120 0%, #111827 100%);
  font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

h1, h2, h3, .brand {
  font-family: 'Manrope', ui-sans-serif, system-ui, sans-serif;
  letter-spacing: -0.02em;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

.screen-shell {
  display: grid;
  grid-template-columns: clamp(300px, 24vw, 440px) minmax(0, 1fr);
  gap: 16px;
  width: 100vw;
  height: 100dvh;
  padding: 16px;
}

.profile-card,
.bento-card {
  min-width: 0;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.profile-card {
  display: flex;
  flex-direction: column;
  gap: 18px;
  height: 100%;
  padding: 22px;
  overflow: hidden;
  background:
    radial-gradient(120% 60% at 0% 0%, rgba(79, 124, 255, 0.07), transparent 60%),
    var(--panel);
}

.profile-head {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.profile-role {
  margin: 0;
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--teal);
}

.profile-sub {
  margin: -6px 0 0;
  font-size: clamp(13px, 0.95vw, 15px);
  font-weight: 400;
  color: var(--muted);
  line-height: 1.5;
}

.profile-quote {
  position: relative;
  margin: 2px 0 0;
  padding: 2px 0 2px 18px;
  border-left: 2px solid var(--teal);
  font-family: 'Manrope', sans-serif;
  font-size: clamp(16px, 1.5vw, 22px);
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
  line-height: 1.28;
}

.profile-foot {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.profile-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 15px 20px;
  border-radius: var(--radius);
  background: var(--primary);
  color: #FFFFFF;
  font-family: 'Manrope', sans-serif;
  font-size: 15px;
  font-weight: 700;
  box-shadow: 0 6px 20px rgba(79, 124, 255, 0.28);
  transition: background 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.profile-cta svg {
  transition: transform 0.18s ease;
}

.profile-cta:hover {
  background: var(--primary-hover);
  box-shadow: 0 8px 26px rgba(79, 124, 255, 0.4);
  transform: translateY(-2px);
}

.profile-cta:hover svg {
  transform: translateX(3px);
}

.brand {
  max-width: none;
  font-size: clamp(22px, 2vw, 30px);
  font-weight: 800;
  line-height: 1;
  color: var(--ink);
}

.profile-nav {
  display: flex;
  flex-direction: column;
  gap: 7px;
  flex: 0 0 auto;
}

.links-card a,
.contact-card a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.05);
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.links-card a {
  color: var(--amber);
  border-color: rgba(147, 197, 253, 0.28);
  background: var(--amber-dim);
}

.links-card a:hover {
  border-color: var(--amber);
  background: rgba(147, 197, 253, 0.2);
}

.profile-media {
  position: relative;
  flex: 1 1 auto;
  min-height: 130px;
  max-height: 56vh;
  overflow: hidden;
  border-radius: var(--radius-sm);
  background: #141d30;
  border: 1px solid var(--line);
}

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

.profile-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 55%, rgba(15, 23, 42, 0.55));
  pointer-events: none;
}

.profile-copy {
  display: flex;
  flex: 0 1 auto;
  min-height: 0;
  flex-direction: column;
  justify-content: flex-start;
}

.eyebrow,
.card-kicker,
.card-overlay span {
  display: block;
  margin: 0 0 9px;
  color: var(--teal);
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: uppercase;
}

.profile-copy h1,
.bento-card h2 {
  margin: 0;
  font-size: clamp(24px, 2.15vw, 34px);
  font-weight: 800;
  line-height: 1.05;
}

.profile-copy p,
.bento-card p,
.metric-card p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: clamp(13px, 1vw, 15px);
  line-height: 1.5;
}

.profile-actions {
  display: flex;
  gap: 8px;
}

.profile-actions a {
  display: grid;
  flex: 1 1 0;
  height: 40px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.profile-actions a:hover {
  border-color: rgba(79, 124, 255, 0.4);
  background: var(--teal-dim);
  color: var(--teal);
}

.masonry-board {
  display: grid;
  min-width: 0;
  min-height: 0;
  height: 100%;
  gap: 16px;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-template-rows: repeat(6, minmax(0, 1fr));
}

.bento-card:not(.image-card) {
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.bento-card:not(.image-card):hover {
  box-shadow: 0 2px 4px rgba(0,0,0,.5), 0 8px 24px rgba(0,0,0,.3);
  border-color: rgba(255, 255, 255, 0.14);
}

.bento-card {
  position: relative;
  display: flex;
  overflow: hidden;
  padding: clamp(16px, 1.6vw, 26px);
  background: var(--panel);
}

.image-card {
  padding: 0;
  background: #0B1120;
}

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

.card-overlay {
  position: absolute;
  right: 14px;
  bottom: 14px;
  left: 14px;
  padding: 14px 16px;
  border-radius: var(--radius);
  color: #fff;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255,255,255,0.06);
}

.card-overlay h2 {
  margin: 0;
  font-size: clamp(18px, 1.85vw, 28px);
}

/* ---------- Posiciones del grid (solo layout) ---------- */
.bento-visual    { grid-column: 1 / span 6;  grid-row: 1 / span 3; }
.bento-status    { grid-column: 7 / span 3;  grid-row: 1 / span 2; }
.bento-year      { grid-column: 10 / span 3; grid-row: 1 / span 2; }
.bento-listening { grid-column: 7 / span 6;  grid-row: 3 / span 2; }
.bento-courses   { grid-column: 1 / span 4;  grid-row: 4 / span 3; }
.bento-reading   { grid-column: 5 / span 2;  grid-row: 4 / span 3; }
.bento-projects  { grid-column: 7 / span 3;  grid-row: 5 / span 2; }
.bento-desk      { grid-column: 10 / span 3; grid-row: 5 / span 2; }

/* ---------- Comunes ---------- */
.bento-eyebrow {
  display: block;
  color: var(--primary);
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1;
}

.bento-link {
  align-self: flex-start;
  color: var(--secondary);
  font-size: 13px;
  font-weight: 500;
}

/* ---------- Imagen (pausa visual) ---------- */
.bento-visual { padding: 0; }
.bento-visual img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Estado live ---------- */
.bento-status {
  flex-direction: column;
  justify-content: center;
  gap: 14px;
  background: color-mix(in srgb, var(--status-color, var(--primary)) 13%, var(--card));
  border-color: color-mix(in srgb, var(--status-color, var(--primary)) 38%, var(--border));
}
.bento-status .bento-eyebrow { color: var(--status-color, var(--primary)); }
.status-live { display: flex; align-items: center; gap: 12px; }
.status-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--status-color, var(--primary));
  animation: status-pulse 2.4s ease-out infinite;
}
.status-label {
  font-family: 'Manrope', sans-serif;
  font-size: clamp(20px, 2vw, 30px);
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--status-color, var(--text-primary));
}
@keyframes status-pulse {
  0%   { box-shadow: 0 0 0 0 color-mix(in srgb, var(--status-color, #4F7CFF) 55%, transparent); }
  70%  { box-shadow: 0 0 0 12px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

/* ---------- Year progress ---------- */
.bento-year {
  flex-direction: column;
  justify-content: center;
  gap: 10px;
  background: var(--card);
}
.year-main { display: flex; align-items: baseline; gap: 8px; }
.year-pct {
  font-family: 'Manrope', sans-serif;
  font-size: clamp(40px, 4.4vw, 64px);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--primary);
  line-height: 0.9;
}
.year-year {
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}
.year-bar {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  overflow: hidden;
}
.year-bar-fill { height: 100%; border-radius: 999px; background: var(--primary); }
.year-left {
  margin: 0 !important;
  color: var(--text-secondary);
  font-size: 12px;
}

/* ---------- Escuchando ---------- */
.bento-listening {
  flex-direction: column;
  justify-content: flex-start;
  gap: 14px;
  background: var(--card);
}
.listening-head { display: flex; align-items: center; gap: 14px; }
.listening-cover {
  width: 64px;
  height: 64px;
  flex: 0 0 auto;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid var(--border);
}
.listening-meta { min-width: 0; }
.listening-meta h3 {
  margin: 6px 0 2px;
  font-family: 'Manrope', sans-serif;
  font-size: clamp(16px, 1.6vw, 22px);
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.1;
}
.listening-meta p { margin: 0; color: var(--text-secondary); font-size: 13px; }
.spotify-embed {
  width: 100%;
  border: none;
  border-radius: 12px;
  margin-top: auto;
}

/* ---------- Cuatrimestre ---------- */
.bento-courses {
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 12px;
  background: var(--card);
}
.courses-term { margin: 0 !important; color: var(--text-secondary); font-size: 13px; }
.courses-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.courses-list li {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
}
.course-name {
  font-family: 'Manrope', sans-serif;
  font-size: clamp(15px, 1.3vw, 18px);
  font-weight: 600;
  color: var(--text-primary);
}
.course-sub { font-size: 12px; color: var(--text-secondary); }

/* ---------- Leyendo ahora ---------- */
.bento-reading {
  flex-direction: column;
  justify-content: flex-start;
  gap: 14px;
  background: var(--card);
}
.reading-cover {
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.reading-cover img { width: 100%; height: 100%; object-fit: cover; }
.reading-meta h3 {
  margin: 0 0 4px;
  font-family: 'Manrope', sans-serif;
  font-size: clamp(15px, 1.3vw, 18px);
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.15;
}
.reading-meta p { margin: 0; color: var(--text-secondary); font-size: 13px; }

/* ---------- Proyectos en desarrollo ---------- */
.bento-projects {
  flex-direction: column;
  justify-content: flex-start;
  gap: 12px;
  background: var(--card);
}
.projects-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.project-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}
.project-title {
  font-family: 'Manrope', sans-serif;
  font-size: clamp(20px, 2vw, 30px);
  font-weight: 800;
  letter-spacing: -0.015em;
  line-height: 1.1;
  color: var(--text-primary);
}
.project-state {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #F59E0B;
}
.project-desc {
  margin: 0 !important;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.4;
}

/* ---------- Escritorio ---------- */
.bento-desk { padding: 0; }
.desk-link { position: relative; display: block; width: 100%; height: 100%; }
.desk-img { width: 100%; height: 100%; object-fit: cover; }
.desk-overlay {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(11, 17, 32, 0.72);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.desk-date { font-size: 13px; font-weight: 500; color: var(--text-primary); }

@media (max-width: 1050px) {
  .screen-shell {
    grid-template-columns: clamp(250px, 32vw, 330px) minmax(0, 1fr);
    gap: 10px;
    padding: 10px;
  }

  .profile-card,
  .masonry-board {
    gap: 10px;
  }

  .profile-card {
    padding: 14px;
  }

  .brand {
    font-size: clamp(22px, 2.8vw, 30px);
  }

  .masonry-board {
    grid-template-columns: repeat(8, minmax(0, 1fr));
    grid-template-rows: repeat(6, minmax(0, 1fr));
  }

  .bento-visual    { grid-column: 1 / span 5;  grid-row: 1 / span 3; }
  .bento-status    { grid-column: 6 / span 3;  grid-row: 1 / span 2; }
  .bento-year      { grid-column: 6 / span 3;  grid-row: 3 / span 1; }
  .bento-listening { grid-column: 1 / span 4;  grid-row: 4 / span 2; }
  .bento-courses   { grid-column: 5 / span 4;  grid-row: 4 / span 2; }
  .bento-reading   { grid-column: 1 / span 3;  grid-row: 6 / span 1; }
  .bento-projects  { grid-column: 4 / span 3;  grid-row: 6 / span 1; }
  .bento-desk      { grid-column: 7 / span 2;  grid-row: 6 / span 1; }
}

@media (max-width: 760px) {
  html,
  body {
    height: auto;
    overflow-x: hidden;
    overflow-y: auto;
  }

  /* todo pasa a una sola columna, scroll vertical natural */
  .screen-shell {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: auto;
    min-height: 100dvh;
    gap: 14px;
    padding: 14px;
  }

  .profile-card {
    height: auto;
    gap: 16px;
    padding: 20px;
  }

  .profile-media {
    flex: none;
    max-height: none;
    height: clamp(300px, 75vw, 460px);
  }

  /* la grilla bento se apila: cada tarjeta debajo de la otra */
  .masonry-board {
    display: flex;
    flex-direction: column;
    height: auto;
    gap: 14px;
  }

  .masonry-board > .bento-card {
    grid-column: auto;
    grid-row: auto;
    width: 100%;
  }

  /* tarjetas de imagen: altura propia para que se vean */
  .image-card {
    height: clamp(240px, 60vw, 360px);
  }
}

@media (max-width: 460px) {
  .screen-shell {
    gap: 12px;
    padding: 12px;
  }

  .profile-card {
    padding: 18px;
  }

  .card-overlay {
    right: 10px;
    bottom: 10px;
    left: 10px;
    padding: 12px;
  }
}

@media (max-height: 640px) and (min-width: 761px) {
  .screen-shell {
    gap: 10px;
    padding: 10px;
  }

  .profile-card {
    gap: 10px;
    padding: 14px;
  }

  .profile-media {
    min-height: 110px;
  }
}
